Initial commit of "Plugin Interface" & supporting directory structure.
[platform/upstream/iotivity.git] / plugins / include / internal / plugintranslatortypes.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 /**
23  * @file
24  *
25  * This file contains the definition, types and APIs for resource(s) be
26  * implemented.
27  */
28
29 #ifndef PLUGINTRANSLATORTYPES_H_
30 #define PLUGINTRANSLATORTYPES_H_
31
32 #include "octypes.h"
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif // __cplusplus
37
38 // This file will hold structs which will help aid in abstraction of zigbee
39 // protocol to a PIPlugin.:
40
41 typedef struct
42 {
43     PIPluginBase * header;
44     struct PIResource_Zigbee * resource; // All resources which exist within this context.
45     //Todo: Whatever other zigbee plugin specific stuff...
46     //Todo:  zigbee_homeautomationprofile profile;
47 } PIPlugin_Zigbee;
48
49 /**
50  *  Header for all PIResources.
51  */
52 typedef struct
53 {
54     struct PIResourceBase * next; // Linked list of resources.
55     PIPluginBase * plugin; // Context this resource exists.
56     OCResourceHandle * resourceHandle; // Handle to OIC Resource.
57 } PIResourceBase;
58
59 typedef struct
60 {
61 // Todo: This needs to map nicely to a struct that's defined in Zigbee_wrapper
62     uint8_t placeholder;
63 // Todo: This struct will be refactored once Zigbee_Wrapper is finished.
64 } PIZigbeeProfile;
65
66 /**
67  * Parameter list for a resource. Abstraction of PIResource.
68  */
69 typedef struct
70 {
71     PIResourceBase * header;
72     PIPlugin_Zigbee * plugin; // Context which this Zigbee device exists.
73     PIZigbeeProfile zigbeeProfile; // Representation of a Zigbee Device.
74 } PIResource_Zigbee;
75
76 #ifdef __cplusplus
77 }
78 #endif // __cplusplus
79
80 #endif /* PLUGINTRANSLATORTYPES_H_ */