Adding an IoTivity/Zigbee sample server
[contrib/iotivity.git] / plugins / include / plugininterface.h
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 PIPlugin module to be implemented.
25  */
26
27 #ifndef PLUGININTERFACE_H_
28 #define PLUGININTERFACE_H_
29
30 #include "plugintypes.h"
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif // __cplusplus
35
36 // Todo: The following APIs can be modified as needed. This just a loose
37 // declaration to illustrate how we can manage our plugins. The types are
38 // defined in plugintypes.h.
39
40 /**
41  *
42  * Makes any required calls to instantiate IoTivity and/or plugin's radio.
43  *
44  * @param[in]  pluginType The type of plugin to start.
45  * @param[out] plugin The plugin handle that will be started.
46  *   Note: Please note that the plugin will need to be managed in the
47  *         application space.
48  */
49 OCStackResult PIStartPlugin(PIPluginType pluginType, PIPluginBase ** plugin);
50
51 /**
52  *
53  * Makes any required calls to stop plugin's radio.
54  *
55  * @param[in] PIStopPlugin The plugin to be stopped.
56  *           Note: If NULL Makes any required calls to stop IoTivity and ALL
57  *                 plugin radios.
58  */
59 OCStackResult PIStopPlugin(PIPluginBase * plugin);
60
61 /**
62  *
63  * Called in main loop of application. Gives cycles for Plugin Interface'
64  * internal operation.
65  *
66  */
67 OCStackResult PIProcess(PIPluginBase * plugin);
68
69 #ifdef __cplusplus
70 }
71 #endif // __cplusplus
72
73 #endif /* PLUGININTERFACE_H_ */