]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0084.git/blob - example/collector/appsrv_proto.h
Initial commit
[apps/tidep0084.git] / example / collector / appsrv_proto.h
1 /******************************************************************************
2  @file appsrv_proto.h
4  @brief TIMAC 2.0 API Convert the wire messages for the appsrv (web) interface
6  Group: WCS LPC
7  $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
9  ******************************************************************************
10  $License: BSD3 2016 $
11   
12    Copyright (c) 2015, Texas Instruments Incorporated
13    All rights reserved.
14   
15    Redistribution and use in source and binary forms, with or without
16    modification, are permitted provided that the following conditions
17    are met:
18   
19    *  Redistributions of source code must retain the above copyright
20       notice, this list of conditions and the following disclaimer.
21   
22    *  Redistributions in binary form must reproduce the above copyright
23       notice, this list of conditions and the following disclaimer in the
24       documentation and/or other materials provided with the distribution.
25   
26    *  Neither the name of Texas Instruments Incorporated nor the names of
27       its contributors may be used to endorse or promote products derived
28       from this software without specific prior written permission.
29   
30    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
32    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
34    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
37    OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
39    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
40    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41  ******************************************************************************
42  $Release Name: TI-15.4Stack Linux x64 SDK$
43  $Release Date: July 14, 2016 (2.00.00.30)$
44  *****************************************************************************/
46 #if !defined(APPSRV2_PROTO_H)
47 #define APPSRV2_PROTO_H
49 #include "api_mac.h"
50 #include "smsgs.h"
52 #include "appsrv.pb-c.h"
54 /*!
55  * @brief release memory for protobuf device data request.
56  * @param pThis - item to be freed.
57  */
58 void free_AppsrvTxDataCnf(AppsrvTxDataCnf *pThis);
60 /*!
61  * @brief create protobuf message tx data confirm.
62  * @param status status to put into the protobuf message
63  * @returns protobuf structure to encode
64  */
65  AppsrvTxDataCnf *copy_AppsrvTxDataCnf(uint8_t status);
67 /*!
68  * @brief Create protobuf device data indication
69  * @param pAddr - address to insert into message
70  * @param rssi  - rssi value to insert into message
71  * @param pSensorMsg - sensor data to insert
72  * @param pCfgRspMsg - the response message to insert
73  * @returns protobuf structure to encode
74  */
75 AppsrvDeviceDataRxInd *copy_AppsrvDeviceDataRxInd(
76     ApiMac_sAddr_t *pAddr,
77     int32_t rssi,
78     Smsgs_sensorMsg_t *pSensorMsg,
79     Smsgs_configRspMsg_t *pCfgRspMsg);
81 /*!
82  * @brief release memory for protobuf device data indication.
83  * @param pThis - item to be freed.
84  */
85 void free_AppsrvDeviceDataRxInd(AppsrvDeviceDataRxInd *pThis);
87 /*!
88  * @brief Create protobuf version of app join confirm
89  * @param pThis - item to be freed.
90  */
91 void free_AppsrvSetJoinPermitCnf(AppsrvSetJoinPermitCnf *pThis);
93 /*!
94  * @brief Release memory for protobuf version of app join confirm
95  * @param status - status to encode in protobuf message
96  * @returns protobuf structure to encode
97  */
98 AppsrvSetJoinPermitCnf *copy_AppsrvSetJoinPermitCnf(int status);
100 /*!
101  * @brief Free the device update indication
102  * @param pThis - item to be freed.
103  */
104 void free_AppsrvDeviceUpdateInd(AppsrvDeviceUpdateInd *pThis);
106 /*!
107  * @brief Release memory for protobuf version of device updated indication
108  * @param pDevListItem - device list istem to encode
109  * @returns protobuf structure to encode
110  */
111 AppsrvDeviceUpdateInd *copy_AppsrvDeviceUpdateInd(Llc_deviceListItem_t *pDevListItem);
113 /*!
114  * @brief Release memory for protobuf version of device updated indication
115  * @param networkinfo - data for the protobuf message
116  * @returns protobuf structure to encode
117  */
118 AppsrvNwkInfoUpdateInd *copy_AppsrvNwkInfoUpdateInd(Llc_netInfo_t *networkInfo);
120 /*!
121  * @brief Release memory for protobuf version of network update indication
122  * @param networkinfo - structure to free
123  */
124 void free_AppsrvNwkInfoUpdateInd(AppsrvNwkInfoUpdateInd *networkInfo);
126 /*!
127  * @brief Release memory for protobuf version of collector state change
128  * @param s - state to encode
129  * @returns protobuf structure to encode
130  */
131 AppsrvCollectorStateCngUpdateInd *copy_AppsrvCollectorStateCngUpdateInd(Cllc_states_t s);
133 /*!
134  * @brief Release memory for protobuf version of collector state change
135  * @param pThis - item to be freed.
136  */
137 void free_AppsrvCollectorStateCngUpdateInd(AppsrvCollectorStateCngUpdateInd *pThis);
139 /*!
140  * @brief convert the GetNetworkInfo conf message
141  * @returns protobuf structure to encode
142  */
143 AppsrvGetNwkInfoCnf *copy_AppsrvGetNwkInfoCnf(void);
145 /*!
146  * @brief free the GetNetworkInfo conf message
147  * @param pThis - item to be freed.
148  */
149 void free_AppsrvGetNwkInfoCnf(AppsrvGetNwkInfoCnf *pThis);
151 /*!
152  * @brief convert the Get Device Array Conf message
153  * @returns protobuf structure to encode
154  */
155 AppsrvGetDeviceArrayCnf *copy_AppsrvGetDeviceArrayCnf(void);
157 /*!
158  * @brief free the Get Device Array Conf message
159  * @param pThis - item to be freed.
160  */
161 void free_AppsrvGetDeviceArrayCnf(AppsrvGetDeviceArrayCnf *pThis);
163 /*!
164  * @brief convert the device not active update indication message.
165  * @param pDevInfo - data for the protobuf structure
166  * @param timeout - data for the protobuf structure
167  * @returns protobuf structure to encode
168  */
169 AppsrvDeviceNotActiveUpdateInd *copy_AppsrvDeviceNotActiveUpdateInd(
170     const ApiMac_deviceDescriptor_t *pDevInfo,
171     bool timeout);
173 /*!
174  * @brief free the Device Not Active ind message
175  * @param pThis - item to be freed.
176  */
177 void free_AppsrvDeviceNotActiveUpdateInd(AppsrvDeviceNotActiveUpdateInd *pThis);
179 /*!
180  * @brief Create protobuf network parameter message
181  * @param pNetInfo - data for the protobuf structure
182  * @param securityenabled - data for the protobuf structure
183  * @returns protobuf structure to encode
184  */
185 AppsrvNwkParam *copy_AppsrvNwkParam(Llc_netInfo_t *pNetInfo, int32_t securityenabled);
187 /*!
188  * @brief Release memory for protobuf network parameter message.
189  * @param pThis - item to be freed.
190  */
191 void free_AppsrvNwkParam(AppsrvNwkParam *pThis);
192 #endif
194 /*
195  *  ========================================
196  *  Texas Instruments Micro Controller Style
197  *  ========================================
198  *  Local Variables:
199  *  mode: c
200  *  c-file-style: "bsd"
201  *  tab-width: 4
202  *  c-basic-offset: 4
203  *  indent-tabs-mode: nil
204  *  End:
205  *  vim:set  filetype=c tabstop=4 shiftwidth=4 expandtab=true
206  */