Developer World
Spresense SDK Library v1.4.0-aa7f53a
geofence.h
1 /****************************************************************************
2  * bsp/include/arch/chip/geofence.h
3  *
4  * Copyright 2018 Sony Semiconductor Solutions Corporation
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  * 3. Neither the name of Sony Semiconductor Solutions Corporation nor
17  * the names of its contributors may be used to endorse or promote
18  * products derived from this software without specific prior written
19  * permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  ****************************************************************************/
35 
36 #ifndef __SDK_BSP_INCLUDE_ARCH_CHIP_GEOFENCE_H
37 #define __SDK_BSP_INCLUDE_ARCH_CHIP_GEOFENCE_H
38 
39 #ifdef __cplusplus
40 #define EXTERN extern "C"
41 extern "C" {
42 #else
43 #define EXTERN extern
44 #endif
45 
53 /* @{ */
54 
63 #define CXD56_GEOFENCE_IOCTL_START 1
64 
73 #define CXD56_GEOFENCE_IOCTL_STOP 2
74 
83 #define CXD56_GEOFENCE_IOCTL_ADD 3
84 
93 #define CXD56_GEOFENCE_IOCTL_MODIFY 4
94 
103 #define CXD56_GEOFENCE_IOCTL_DELETE 5
104 
113 #define CXD56_GEOFENCE_IOCTL_ALL_DELETE 6
114 
124 #define CXD56_GEOFENCE_IOCTL_GET_REGION_DATA 7
125 
137 #define CXD56_GEOFENCE_IOCTL_GET_USED_ID 8
138 
148 #define CXD56_GEOFENCE_IOCTL_GET_ALL_STATUS 9
149 
158 #define CXD56_GEOFENCE_IOCTL_SET_MODE 10
159 
160 /* check macros for GNSS commands */
161 
162 #define CXD56_GEOFENCE_IOCTL_INVAL 0
163 #define CXD56_GEOFENCE_IOCTL_MAX 11
164 
165 /* @} geofence_ioctl */
166 
175 /* @{ */
176 
179 #define CXD56_GEOFENCE_TRANSITION_EXIT 0
180 
183 #define CXD56_GEOFENCE_TRANSITION_ENTER 1
184 
187 #define CXD56_GEOFENCE_TRANSITION_DWELL 2
188 
189 /* @} GEOFENCE transition type */
190 
194 /* @{ */
197 #define CXD56_GEOFENCE_REGION_CAPACITY 20
198 
199 /* @} */
200 
201 /* @} geofence_defs */
202 
203 
217 {
220  uint8_t id;
221 
224  long latitude;
225 
228  long longitude;
229 
232  uint16_t radius;
233 };
234 
240 {
241  uint16_t deadzone;
242  uint16_t dwell_detecttime;
243 };
244 
250 {
253  uint8_t id;
254 
260  uint8_t status;
261 };
262 
268 {
271  uint8_t update;
272 
276 };
277 
278 /* @} geofence_datatypes */
279 /* @} */
280 
281 #undef EXTERN
282 #ifdef __cplusplus
283 }
284 #endif
285 
286 #endif /* __SDK_BSP_INCLUDE_ARCH_CHIP_GEOFENCE_H */
Region center point and radius data.
Definition: geofence.h:216
uint16_t radius
Definition: geofence.h:232
uint8_t status
Definition: geofence.h:260
Geofence mode setting parameter.
Definition: geofence.h:239
#define CXD56_GEOFENCE_REGION_CAPACITY
Definition: geofence.h:197
uint8_t id
Definition: geofence.h:253
uint16_t deadzone
Definition: geofence.h:241
uint16_t dwell_detecttime
Definition: geofence.h:242
uint8_t id
Definition: geofence.h:220
Geofence output data structer.
Definition: geofence.h:267
long longitude
Definition: geofence.h:228
uint8_t update
Definition: geofence.h:271
long latitude
Definition: geofence.h:224
The transition data.
Definition: geofence.h:249