9b01eb8d61a477b2bedb21b1077d94e6056ce013
[platform/core/connectivity/zigbee-manager.git] / common / include / zigbee_service_type.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Contact: Suresh Kumar N (suresh.n@samsung.com)
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef __ZIGBEE_SERVICE_TYPE_H__
20 #define __ZIGBEE_SERVICE_TYPE_H__
21
22 #include <zigbee_types.h>
23
24 /* --------------------------------------------------------------------------------------
25  * For Requests
26  * -------------------------------------------------------------------------------------*/
27 /**
28  * @brief Definition for service coex start structure.
29  * @since_tizen 3.0
30  */
31 typedef struct {
32         char channel; /**< Channel */
33 } ZigbeeServiceCoexStart_t;
34
35 /**
36  * @brief Definition for service permit join structure.
37  * @since_tizen 3.0
38  */
39 typedef struct {
40         char permit_join; /* 1 - Allow, 0 - Disallow */
41         int duration; /**< Duration */
42 } ZigbeeServicePermitJoin_t;
43
44 /**
45  * @brief Definition for service leave request structure.
46  * @since_tizen 3.0
47  */
48 typedef struct {
49         char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
50         char remove_child; /* Remove child */
51         char rejoin; /**< Re-join */
52 } ZigbeeServiceLeaveRequest_t;
53
54 /**
55  * @brief Definition for service get endpoint list structure.
56  * @since_tizen 3.0
57  */
58 typedef struct {
59         char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
60 } ZigbeeServiceGetEndpointList_t;
61
62 /**
63  * @brief Definition for service get cluster list structure.
64  * @since_tizen 3.0
65  */
66 typedef struct {
67         char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
68         char endpoint; /**< Endpoint */
69 } ZigbeeServiceGetClusterList_t;
70
71 /**
72  * @brief Definition for service get node type structure.
73  * @since_tizen 3.0
74  */
75 typedef struct {
76         char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
77 } ZigbeeServiceGetNodeType_t;
78
79 /* --------------------------------------------------------------------------------------
80  * For Responses
81  * -------------------------------------------------------------------------------------*/
82
83  /**
84  * @brief Definition for service 'enabled' response.
85  * @since_tizen 4.0
86  */
87 typedef struct {
88         int result; /**< Result */
89         char enabled; /**< Enabled / Disabled result */
90 } ZigbeeServiceServiceStateResp_t;
91
92 /**
93  * @brief Definition for get network info structure.
94  * @since_tizen 3.0
95  */
96 typedef struct {
97         int result; /**< Result */
98         char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
99         short node_id; /**< Node ID (an Network address) */
100         short pan_id; /**< PAN ID (an Network address) */
101         char channel; /**< Channel number */
102         char radio_tx_power;  /**< Power (dBm) */
103 } ZigbeeServiceGetNetworkInfoResp_t;
104
105 /**
106  * @brief Definition for service 'get_node_type' response.
107  * @since_tizen 4.0
108  */
109 typedef struct {
110         int result; /**< Result */
111         char node_type; /**< Node Type */
112 } ZigbeeServiceServiceNodeTypeResp_t;
113
114 /**
115  * @brief Definition for service get mac structure.
116  * @since_tizen 3.0
117  */
118 typedef struct {
119         int result; /**< Result */
120         char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
121 } ZigbeeServiceGetMacResp_t;
122
123 /**
124  * @brief Definition for service get details of device info structure.
125  * @since_tizen 3.0
126  */
127 typedef struct {
128         short node_id; /**< Node ID (an Network address) */
129         char node_type; /**< Node Type (an Network address) */
130         char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
131         char endpoint_count; /**< The number of endpoints */
132         char endpoints[ZIGBEE_MAX_ENDPOINTS]; /**< Endpoints */
133 } ZigbeeServiceGetDeviceInfoDetailResp_t;
134
135 /**
136  * @brief Definition for service get device info structure.
137  * @since_tizen 3.0
138  */
139 typedef struct {
140         int result; /**< Result */
141         int count; /**< The number of detail item */
142         ZigbeeServiceGetDeviceInfoDetailResp_t *list;
143 } ZigbeeServiceGetDeviceInfoResp_t;
144
145 /**
146  * @brief Definition for service get endpoint list structure.
147  * @since_tizen 3.0
148  */
149 typedef struct {
150         int result; /**< Result */
151         int endpoint_count; /**< The number of endpoints */
152         char endpoints[ZIGBEE_MAX_ENDPOINTS]; /**< Endpoints */
153 } ZigbeeServiceGetEndpointListResp_t;
154
155 /**
156  * @brief Definition for service get cluster list structure.
157  * @since_tizen 3.0
158  */
159 typedef struct {
160         int result; /**< Result */
161         int cluster_count; /**< The number of clusters */
162         char clusters[ZIGBEE_MAX_CLUSTERS]; /**< Clusters */
163 } ZigbeeServiceGetClusterListResp_t;
164
165 /**
166  * @brief Definition for service get node type structure.
167  * @since_tizen 3.0
168  */
169 typedef struct {
170         int result; /**< Result */
171         char node_type; /**< Node Type (an Network address) */
172 } ZigbeeServiceGetNodeTypeResp_t;
173
174 /* --------------------------------------------------------------------------------------
175  * For Notifications
176  * -------------------------------------------------------------------------------------*/
177
178 /**
179  * @brief Definition for service 'form_network_done' response.
180  * @since_tizen 4.0
181  */
182 typedef struct {
183         short pan_id; /**< PAN ID */
184 } ZigbeeServiceServiceFormNetworkDone_t;
185
186 /**
187  * @brief Definition for service 'child_joined' response.
188  * @since_tizen 4.0
189  */
190 typedef struct {
191         char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
192         int endpoint_count; /**< The number of endpoints */
193         char endpoints[ZIGBEE_MAX_ENDPOINTS]; /**< Endpoints */
194         short node_id; /**< Node ID (an Network address) */
195 } ZigbeeServiceServiceChildJoined_t;
196
197 /**
198  * @brief Definition for service 'child_rejoined' response.
199  * @since_tizen 4.0
200  */
201 typedef struct {
202         char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
203 } ZigbeeServiceServiceChildRejoined_t;
204
205 /**
206  * @brief Definition for service 'child_left' response.
207  * @since_tizen 4.0
208  */
209 typedef struct {
210         char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
211         char status; /**< status */
212 } ZigbeeServiceServiceChildLeft_t;
213
214 /**
215  * @brief Definition for service 'leave_network_done' response.
216  * @since_tizen 4.0
217  */
218 typedef struct {
219         short pan_id; /**< PAN ID */
220 } ZigbeeServiceServiceLeaveNetworkDone_t;
221
222
223 #endif /* __ZIGBEE_SERVICE_TYPE_H__ */