Initial commit of "Plugin Interface" & supporting directory structure.
[platform/upstream/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] plugin The plugin to be started.
45  *   Note: Please note that the plugin will need to be managed in the
46  *         application space.
47  */
48 OCStackResult PIStartPlugin(PIPluginBase * plugin);
49
50 /**
51  *
52  * Makes any required calls to stop plugin's radio.
53  *
54  * @param[in] PIStopPlugin The plugin to be stopped.
55  *           Note: If NULL Makes any required calls to stop IoTivity and ALL
56  *                 plugin radios.
57  */
58 OCStackResult PIStopPlugin(PIPluginBase * plugin);
59
60 /**
61  *
62  * Called in main loop of application. Gives cycles for Plugin Interface'
63  * internal operation.
64  *
65  */
66 OCStackResult PIProcess(PIPluginBase * plugin);
67
68 #ifdef __cplusplus
69 }
70 #endif // __cplusplus
71
72 #endif /* PLUGININTERFACE_H_ */