91759dd4e270d472ee3f86bf2bb9397394b6f7bc
1 /******************************************************************************
3 @file smsgs.proto
5 @brief TIMAC 2.0 - Protobuf definition for items in the smsgs.h (sensor) file
8 Group: WCS LPC
9 $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
11 ******************************************************************************
12 $License: BSD3 2016 $
14 Copyright (c) 2015, Texas Instruments Incorporated
15 All rights reserved.
17 Redistribution and use in source and binary forms, with or without
18 modification, are permitted provided that the following conditions
19 are met:
21 * Redistributions of source code must retain the above copyright
22 notice, this list of conditions and the following disclaimer.
24 * Redistributions in binary form must reproduce the above copyright
25 notice, this list of conditions and the following disclaimer in the
26 documentation and/or other materials provided with the distribution.
28 * Neither the name of Texas Instruments Incorporated nor the names of
29 its contributors may be used to endorse or promote products derived
30 from this software without specific prior written permission.
32 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
33 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
34 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
35 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
36 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
37 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
38 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
39 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
40 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
41 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 ******************************************************************************
44 $Release Name: TI-15.4Stack Linux x64 SDK$
45 $Release Date: July 14, 2016 (2.00.00.30)$
46 *****************************************************************************/
48 syntax = "proto2";
50 /*!
51 Message IDs for Sensor data messages. When sent over-the-air in a message,
52 this field is one byte.
53 */
54 enum Smsgs_cmdIds
55 {
56 /*! Configuration message, sent from the collector to the sensor */
57 Smsgs_cmdIds_configReq = 1;
58 /*! Configuration Response message, sent from the sensor to the collector */
59 Smsgs_cmdIds_configRsp = 2;
60 /*! Tracking request message, sent from the the collector to the sensor */
61 Smsgs_cmdIds_trackingReq = 3;
62 /*! Tracking response message, sent from the sensor to the collector */
63 Smsgs_cmdIds_trackingRsp = 4;
64 /*! Sensor data message, sent from the sensor to the collector */
65 Smsgs_cmdIds_sensorData = 5;
66 /* Toggle LED message, sent from the collector to the sensor */
67 Smsgs_cmdIds_toggleLedReq = 6;
68 /* Toggle LED response msg, sent from the sensor to the collector */
69 Smsgs_cmdIds_toggleLedRsp = 7;
70 }
72 /*!
73 Frame Control field states what data fields are included in reported
74 sensor data, each value is a bit mask value so that they can be combined
75 (OR'd together) in a control field.
76 When sent over-the-air in a message this field is 2 bytes.
77 */
78 enum Smsgs_dataFields
79 {
80 /*! Temperature Sensor */
81 Smsgs_dataFields_tempSensor = 0x0001;
82 /*! Light Sensor */
83 Smsgs_dataFields_lightSensor = 0x0002;
84 /*! Humidity Sensor */
85 Smsgs_dataFields_humiditySensor = 0x0004;
86 /*! Message Statistics */
87 Smsgs_dataFields_msgStats = 0x0008;
88 /*! Config Settings */
89 Smsgs_dataFields_configSettings = 0x0010;
90 /*! Pressure sensor*/
91 Smsgs_dataFields_pressureSensor = 0x0020;
92 /*! Suyash changed this to 0x300 from 0x200 Toggle Settings */
93 Smsgs_dataFields_toggleSettings = 0x0030;
95 }
97 /*!
98 Status values for the over-the-air messages
99 */
100 enum Smsgs_statusValues
101 {
102 /*! Success */
103 Smsgs_statusValues_success = 0;
104 /*! Message was invalid and ignored */
105 Smsgs_statusValues_invalid = 1;
106 /*!
107 Config message was received but only some frame control fields
108 can be sent or the reportingInterval or pollingInterval fail
109 range checks.
110 */
111 Smsgs_statusValues_partialSuccess = 2;
112 }
114 /******************************************************************************
115 Structures - Building blocks for the over-the-air sensor messages
116 *****************************************************************************/
118 /*!
119 Configuration Request message: sent from controller to the sensor.
120 */
121 message Smsgs_configReqMsg
122 {
123 /*! Command ID - 1 byte */
124 required Smsgs_cmdIds cmdId = 1;
125 /*! Frame Control field - bit mask of Smsgs_dataFields */
126 required uint32 frameControl = 2;
127 /*! Reporting Interval */
128 required uint32 reportingInterval = 3;
129 /*! Polling Interval */
130 required uint32 pollingInterval = 4;
131 }
133 /*!
134 Configuration Response message: sent from the sensor to the collector
135 in response to the Configuration Request message.
136 */
137 message Smsgs_configRspMsg
138 {
139 /*! Command ID - 1 byte */
140 required Smsgs_cmdIds cmdId = 1;
141 /*! Response Status - 1 byte */
142 required Smsgs_statusValues status = 2;
143 /*! Frame Control field - bit mask of Smsgs_dataFields */
144 required uint32 frameControl = 3;
145 /*! Reporting Interval */
146 required uint32 treportingInterval = 4;
147 /*! Polling Interval */
148 required uint32 pollingInterval = 5;
149 }
151 /*!
152 Tracking Request message: sent from controller to the sensor.
153 */
154 message Smsgs_trackingReqMsg
155 {
156 /*! Command ID */
157 required Smsgs_cmdIds cmdId = 1;
158 }
160 /*!
161 Tracking Response message: sent from the sensor to the collector
162 in response to the Tracking Request message.
163 */
164 message Smsgs_trackingRspMsg
165 {
166 /*! Command ID */
167 required Smsgs_cmdIds cmdId = 1;
168 }
170 /*!
171 Toggle Request message: sent from controller to the sensor.
172 */
173 message Smsgs_toggleLedReqMsg
174 {
175 /*! Command ID - 1 byte */
176 required Smsgs_cmdIds cmdId = 1;
177 }
179 /*!
180 Toggle Response message: sent from sensor to the controller.
181 */
182 message Smsgs_toggleLedRspMsg
183 {
184 /*! Command ID - 1 byte */
185 required Smsgs_cmdIds cmdId = 1;
186 /*! Response Status - 2 bytes */
187 required uint32 ledState = 2;
188 }
191 /*!
192 Temp Sensor Field
193 */
194 message Smsgs_tempSensorField
195 {
196 /*!
197 Ambience Chip Temperature - each value represents a 0.01 C
198 degree, so a value of 2475 represents 24.75 C.
199 */
200 required uint32 ambienceTemp = 1;
201 /*!
202 Object Temperature - each value represents a 0.01 C
203 degree, so a value of 2475 represents 24.75 C.
204 */
205 required uint32 objectTemp = 2;
206 }
208 /*!
209 Light Sensor Field
210 */
211 message Smsgs_lightSensorField
212 {
213 /*! Raw Sensor Data read out of the OPT2001 light sensor */
214 required uint32 rawData = 1;
215 }
217 /*!
218 Pressure Sensor Field
219 */
220 message Smsgs_pressureSensorField
221 {
222 /*! Temperature value read out of the BMP280 pressure sensor */
223 required uint32 tempValue =1;
225 /*! Pressure value read out of the BMP280 pressure sensor */
226 required uint32 pressureValue=2 ;
227 }
231 /*!
232 Humidity Sensor Field
233 */
234 message Smsgs_humiditySensorField
235 {
236 /*! Raw Temp Sensor Data from the TI HCD1000 humidity sensor. */
237 required uint32 temp = 1;
238 /*! Raw Humidity Sensor Data from the TI HCD1000 humidity sensor. */
239 required uint32 humidity = 2;
240 }
242 /*!
243 Message Statistics Field
244 */
245 message Smsgs_msgStatsField
246 {
247 /*! total number of join attempts (associate request sent) */
248 required uint32 joinAttempts = 1;
249 /*! total number of join attempts failed */
250 required uint32 joinFails = 2;
251 /*! total number of sensor data messages attempted. */
252 required uint32 msgsAttempted = 3;
253 /*! total number of sensor data messages sent. */
254 required uint32 msgsSent = 4;
255 /*! total number of tracking requests received */
256 required uint32 trackingRequests = 5;
257 /*! total number of tracking response attempted */
258 required uint32 trackingResponseAttempts = 6;
259 /*! total number of tracking response success */
260 required uint32 trackingResponseSent = 7;
261 /*!
262 Total number of Channel Access Failures. These are indicated in MAC data
263 confirms for MAC data requests.
264 */
265 required uint32 channelAccessFailures = 8;
266 /*!
267 Total number of MAC ACK failures. These are indicated in MAC data
268 confirms for MAC data requests.
269 */
270 required uint32 macAckFailures = 9;
271 /*!
272 Total number of MAC data request failures, other than channel access
273 failure or MAC ACK failures.
274 */
275 required uint32 otherDataRequestFailures = 10;
276 /*! Total number of sync loss failures received for sleepy devices. */
277 required uint32 syncLossIndications = 11;
278 }
280 /*!
281 Message Statistics Field
282 */
283 message Smsgs_configSettingsField
284 {
285 /*!
286 Reporting Interval - in millseconds, how often to report, 0
287 means reporting is off
288 */
289 required uint32 reportingInterval = 1;
290 /*!
291 Polling Interval - in millseconds (32 bits) - If the sensor device is
292 a sleep device, this states how often the device polls its parent for
293 data. This field is 0 if the device doesn't sleep.
294 */
295 required uint32 pollingInterval = 2;
296 }
298 /*!
299 Sensor Data message: sent from the sensor to the collector
300 */
301 message Smsgs_sensorMsg
302 {
303 /*! Command ID */
304 required Smsgs_cmdIds cmdId = 1;
305 /*! Dummy value so we have a fixed item */
306 required uint32 frameControl = 2; /*uint16_t*/
307 /*!
308 Temp Sensor field
309 */
310 optional Smsgs_tempSensorField tempSensor = 3;
311 /*!
312 Light Sensor field
313 is set in frameControl.
314 */
315 optional Smsgs_lightSensorField lightSensor = 4;
316 /*!
317 Humidity Sensor field
318 */
319 optional Smsgs_humiditySensorField humiditySensor = 5;
320 /*!
321 Message Statistics field
322 */
323 optional Smsgs_msgStatsField msgStats = 6;
324 /*!
325 Configuration Settings field
326 */
327 optional Smsgs_configSettingsField configSettings = 7;
328 /*!
329 Pressure Sensor Field
330 */
331 optional Smsgs_pressureSensorField pressureSensor = 8;
332 }
334 // ========================================
335 // Texas Instruments Micro Controller Style
336 // ========================================
337 // Local Variables:
338 // mode: protobuf
339 // tab-width: 4
340 // c-basic-offset: 4
341 // indent-tabs-mode: nil
342 // End:
343 // vim:set tabstop=4 shiftwidth=4 expandtab=true