nRF5 SDK for Mesh v5.0.0
sensor_common.h
1 /* Copyright (c) 2010 - 2020, Nordic Semiconductor ASA
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice, this
8  * list of conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form, except as embedded into a Nordic
11  * Semiconductor ASA integrated circuit in a product or a software update for
12  * such product, must reproduce the above copyright notice, this list of
13  * conditions and the following disclaimer in the documentation and/or other
14  * materials provided with the distribution.
15  *
16  * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
17  * contributors may be used to endorse or promote products derived from this
18  * software without specific prior written permission.
19  *
20  * 4. This software, with or without modification, must only be used with a
21  * Nordic Semiconductor ASA integrated circuit.
22  *
23  * 5. Any software provided in binary form under this license must not be reverse
24  * engineered, decompiled, modified and/or disassembled.
25  *
26  * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
27  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28  * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
29  * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
30  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
32  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
35  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef SENSOR_COMMON_H__
39 #define SENSOR_COMMON_H__
40 
41 #include <stdint.h>
42 
43 
53 #define SENSOR_COMPANY_ID (0xFFFF)
54 
60 #define SENSOR_NO_PROPERTY_ID (0)
61 
67 #define SENSOR_MOTION_SENSED_PROPERTY_ID (0x0042)
68 
74 #define SENSOR_PRESENCE_DETECT_PROPERTY_ID (0x004D)
75 
81 #define SENSOR_DESCRIPTOR_MSG_SIZE (8)
82 
83 typedef uint8_t * sensor_property_data_size_t;
84 
91 typedef struct
92 {
93  uint16_t property_id;
95 
97 typedef struct
98 {
99  uint16_t property_id;
101 
103 typedef struct
104 {
105  uint16_t property_id;
107 
109 typedef struct
110 {
111  uint16_t property_id;
112  uint16_t * setting_property_ids;
114 
116 typedef struct
117 {
118  uint16_t property_id;
121 
123 typedef struct
124 {
125  uint16_t property_id;
127  uint8_t setting_raw;
129 
131 typedef struct
132 {
133  uint16_t property_id;
135  uint8_t setting_access;
136  uint8_t setting_raw;
138 
140 typedef struct
141 {
142  uint16_t property_id;
144 
146 typedef struct
147 {
148  uint16_t property_id;
149  uint8_t raw_value_x;
151 
153 typedef struct
154 {
155  uint16_t property_id;
156  uint8_t raw_value_x;
157  uint8_t column_width;
158  uint8_t raw_value_y;
160 
162 typedef struct
163 {
164  uint16_t property_id;
165  uint8_t raw_value_x1;
166  uint8_t raw_value_x2;
168 
170 typedef struct
171 {
172  uint16_t property_id;
173  uint8_t raw_value_x_n;
174  uint8_t column_width_n;
175  uint8_t raw_value_y_n;
177 
179 typedef struct
180 {
181  uint16_t property_id;
186  uint8_t update_interval;
188 
190 #endif /* SENSOR_COMMON_H__ */
Parameters for the Sensor Get message.
uint16_t property_id
Sensor property ID.
uint16_t property_id
Sensor property ID.
Definition: sensor_common.h:93
uint8_t raw_value_x_n
The nth column X axis.
Parameters for the Sensor Series Status message.
uint16_t setting_property_id
Setting Property ID identifying a setting within a sensor.
uint16_t negative_tolerance
12-bit value for possible negative sensor error
uint8_t sampling_function
Sampling function applied to measured sensor values.
Parameters for the Sensor Cadence Get message.
Definition: sensor_common.h:97
uint16_t * setting_property_ids
Sequence of Setting Property IDs identifying settings within a sensor.
uint8_t update_interval
Interval between measurement updates in seconds.
Parameters for the Sensor Series Get message.
uint8_t setting_raw
Raw value for the setting.
uint8_t raw_value_x
Raw value identifying a column.
Parameters for the Sensor Settings Get message.
uint16_t positive_tolerance
12-bit value for possible positive sensor error
uint16_t property_id
Property ID for sensor.
uint8_t raw_value_x
Raw value representing the left corner of the column on the X axis.
uint16_t property_id
Sensor property ID.
uint16_t property_id
Sensor property ID.
uint16_t property_id
Sensor property ID.
Definition: sensor_common.h:99
Parameters for the Sensor Settings Status message.
uint16_t property_id
Sensor property ID.
uint8_t measurement_period
Period over which measurement is taken in seconds.
uint16_t property_id
Sensor property ID.
uint16_t setting_property_id
Setting Property ID identifying a setting within a sensor.
Parameters for the Sensor Setting Set message.
uint8_t column_width_n
The nth column width.
uint8_t raw_value_x1
Raw value identifying a starting column (Optional)
uint8_t setting_access
Read/Write access rights for the setting (Optional)
uint8_t column_width
Raw value representing the width of the column (Optional)
uint8_t setting_raw
Raw value for the setting.
uint16_t property_id
Sensor property ID.
Parameters for the Sensor Column Get message.
Parameters for the Sensor Setting Get message.
uint8_t raw_value_y
Raw value representing the height of the column on the Y axis.
uint8_t raw_value_x2
Raw value identifying an ending column.
Parameters for the Sensor Column Status message.
Parameters for the Sensor Setting Status message.
uint16_t setting_property_id
Setting Property ID identifying a setting within a sensor.
uint8_t raw_value_y_n
The nth column height.
uint16_t property_id
Identifies a sensor.
Unpacked message structure typedefs are used for API interfaces and for implementing model code...
Definition: sensor_common.h:91
uint16_t property_id
Sensor property ID.
Parameters for the Sensor Descriptor.
uint16_t property_id
Sensor property ID.
uint16_t property_id
Identifies a sensor and the Y axis.

Documentation feedback | Developer Zone | Subscribe | Updated