Adding an IoTivity/Zigbee sample server
[contrib/iotivity.git] / plugins / src / plugininterface.c
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 /**
22  * @file
23  *
24  * This file contains APIs for Plugin Interface module to be implemented.
25  */
26
27 #include "plugininterface.h"
28 #include "plugininterfaceinternal.h"
29 #include "plugintranslatortypes.h"
30
31 // Internal Note: This API will try to start IoTivity. If it is already
32 //                started, nothing will occur. The IoTivity stack will not
33 //                allow another instance to occur within the same program space
34 //                and will even return a soft success when we try (ie.
35 //                OC_STACK_OK).
36 OCStackResult PIStartPlugin(PIPluginType pluginType, PIPluginBase** plugin)
37 {
38     return OC_STACK_NOTIMPL;
39 }
40
41 OCStackResult PIStopPlugin(PIPluginBase * plugin)
42 {
43     return OC_STACK_NOTIMPL;
44 }
45
46 OCStackResult PIProcess(PIPluginBase * plugin)
47 {
48     OCStackResult result = OC_STACK_OK;
49     if(!plugin)
50     {
51         return OC_STACK_INVALID_PARAM;
52     }
53     if(plugin->type == PLUGIN_ZIGBEE)
54     {
55         result = ProcessZigbee((PIPlugin_Zigbee *) plugin);
56         if(result != OC_STACK_OK)
57         {
58             return result;
59         }
60     }
61     else
62     {
63         return OC_STACK_ERROR;
64     }
65     return result;
66 }
67
68 OCStackResult ProcessZigbee(PIPlugin_Zigbee * plugin)
69 {
70     return OC_STACK_OK;
71 }