nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
json_validate.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#define TEST_VALIDATE_BATTERY_JSON_SCHEMA \
8 "{" \
9 "\"bat\":{" \
10 "\"v\":3600," \
11 "\"ts\":1563968747123" \
12 "}" \
13 "}"
14
15#define TEST_VALIDATE_GNSS_JSON_SCHEMA \
16 "{" \
17 "\"gnss\":{" \
18 "\"v\":{" \
19 "\"lat\":62," \
20 "\"lng\":10," \
21 "\"acc\":24," \
22 "\"alt\":170," \
23 "\"spd\":1," \
24 "\"hdg\":176" \
25 "}," \
26 "\"ts\":1563968747123" \
27 "}" \
28 "}"
29
30#define TEST_VALIDATE_ENVIRONMENTAL_JSON_SCHEMA \
31 "{" \
32 "\"env\":{" \
33 "\"v\":{" \
34 "\"temp\":23," \
35 "\"hum\":50," \
36 "\"atmp\":101," \
37 "\"bsec_iaq\":50" \
38 "}," \
39 "\"ts\":1563968747123" \
40 "}" \
41 "}"
42
43#define TEST_VALIDATE_ENVIRONMENTAL_JSON_SCHEMA_AIR_QUALITY_DISABLED \
44 "{" \
45 "\"env\":{" \
46 "\"v\":{" \
47 "\"temp\":23," \
48 "\"hum\":50," \
49 "\"atmp\":101" \
50 "}," \
51 "\"ts\":1563968747123" \
52 "}" \
53 "}"
54
55#define TEST_VALIDATE_MODEM_DYNAMIC_JSON_SCHEMA \
56 "{" \
57 "\"roam\":{" \
58 "\"v\":{" \
59 "\"band\":3," \
60 "\"nw\":\"NB-IoT\"," \
61 "\"rsrp\":-8," \
62 "\"area\":12," \
63 "\"mccmnc\":24202," \
64 "\"cell\":33703719," \
65 "\"ip\":\"10.81.183.99\"" \
66 "}," \
67 "\"ts\":1563968747123" \
68 "}" \
69 "}"
70
71#define TEST_VALIDATE_MODEM_STATIC_JSON_SCHEMA \
72 "{" \
73 "\"dev\":{" \
74 "\"v\":{" \
75 "\"imei\":\"352656106111232\"," \
76 "\"iccid\":\"89450421180216211234\"," \
77 "\"modV\":\"mfw_nrf9160_1.2.3\"," \
78 "\"brdV\":\"nrf9160dk_nrf9160\"," \
79 "\"appV\":\"v1.0.0-development\"" \
80 "}," \
81 "\"ts\":1563968747123" \
82 "}" \
83 "}"
84
85#define TEST_VALIDATE_UI_JSON_SCHEMA \
86 "{" \
87 "\"btn\":{" \
88 "\"v\":1," \
89 "\"ts\":1563968747123" \
90 "}" \
91 "}"
92
93#define TEST_VALIDATE_IMPACT_JSON_SCHEMA \
94 "{" \
95 "\"impact\":{" \
96 "\"v\":300," \
97 "\"ts\":1563968747123" \
98 "}" \
99 "}"
100
101#define TEST_VALIDATE_NEIGHBOR_CELLS_JSON_SCHEMA \
102 "{" \
103 "\"lte\":{" \
104 "\"mcc\":242," \
105 "\"mnc\":1," \
106 "\"cell\":21679716," \
107 "\"area\":40401," \
108 "\"earfcn\":6446," \
109 "\"adv\":80," \
110 "\"rsrp\":-7," \
111 "\"rsrq\":28," \
112 "\"ts\":1563968747123," \
113 "\"nmr\":[" \
114 "{" \
115 "\"earfcn\":262143," \
116 "\"cell\":501," \
117 "\"rsrp\":-8," \
118 "\"rsrq\":25" \
119 "}," \
120 "{" \
121 "\"earfcn\":262265," \
122 "\"cell\":503," \
123 "\"rsrp\":-5," \
124 "\"rsrq\":20" \
125 "}" \
126 "]" \
127 "}" \
128 "}"
129
130#define TEST_VALIDATE_WIFI_AP_JSON_DATA \
131 "{" \
132 "\"wifi\":{" \
133 "\"ts\":1563968747123," \
134 "\"aps\":[" \
135 "\"1300a5a0d29c\"," \
136 "\"5c35b5c27b3e\"," \
137 "\"7344f6c900cd\"," \
138 "\"545e8d443d81\"" \
139 "]" \
140 "}" \
141 "}"
142
143#define TEST_VALIDATE_AGNSS_REQUEST_JSON_SCHEMA \
144 "{" \
145 "\"mcc\":242," \
146 "\"mnc\":1," \
147 "\"area\":40401," \
148 "\"cell\":21679716," \
149 "\"types\":[" \
150 "1," \
151 "2," \
152 "3," \
153 "4," \
154 "5," \
155 "6," \
156 "7," \
157 "8," \
158 "9" \
159 "]" \
160 "}"
161
162#define TEST_VALIDATE_PGPS_REQUEST_JSON_SCHEMA \
163 "{" \
164 "\"n\":42," \
165 "\"int\":240," \
166 "\"day\":15160," \
167 "\"time\":40655" \
168 "}"
169
170#define TEST_VALIDATE_ARRAY_BATTERY_JSON_SCHEMA \
171 "[" \
172 "{" \
173 "\"v\":3600," \
174 "\"ts\":1563968747123" \
175 "}" \
176 "]"
177
178#define TEST_VALIDATE_ARRAY_GNSS_JSON_SCHEMA \
179 "[" \
180 "{" \
181 "\"v\":{" \
182 "\"lat\":62," \
183 "\"lng\":10," \
184 "\"acc\":24," \
185 "\"alt\":170," \
186 "\"spd\":1," \
187 "\"hdg\":176" \
188 "}," \
189 "\"ts\":1563968747123" \
190 "}" \
191 "]"
192
193#define TEST_VALIDATE_ARRAY_GNSS_NO_HEADING_JSON_SCHEMA \
194 "[" \
195 "{" \
196 "\"v\":{" \
197 "\"lat\":62," \
198 "\"lng\":10," \
199 "\"acc\":24," \
200 "\"alt\":170," \
201 "\"spd\":1" \
202 "}," \
203 "\"ts\":1563968747123" \
204 "}" \
205 "]"
206
207#define TEST_VALIDATE_ARRAY_ENVIRONMENTAL_JSON_SCHEMA \
208 "[" \
209 "{" \
210 "\"v\":{" \
211 "\"temp\":23," \
212 "\"hum\":50," \
213 "\"atmp\":101," \
214 "\"bsec_iaq\":55" \
215 "}," \
216 "\"ts\":1563968747123" \
217 "}" \
218 "]"
219
220#define TEST_VALIDATE_ARRAY_MODEM_DYNAMIC_JSON_SCHEMA \
221 "[" \
222 "{" \
223 "\"v\":{" \
224 "\"band\":20," \
225 "\"nw\":\"LTE-M\"," \
226 "\"rsrp\":-8," \
227 "\"area\":12," \
228 "\"mccmnc\":24202," \
229 "\"cell\":33703719," \
230 "\"ip\":\"10.81.183.99\"" \
231 "}," \
232 "\"ts\":1563968747123" \
233 "}" \
234 "]"
235
236#define TEST_VALIDATE_ARRAY_MODEM_STATIC_JSON_SCHEMA \
237 "[" \
238 "{" \
239 "\"v\":{" \
240 "\"imei\":\"352656106111232\"," \
241 "\"iccid\":\"89450421180216211234\"," \
242 "\"modV\":\"mfw_nrf9160_1.2.3\"," \
243 "\"brdV\":\"nrf9160dk_nrf9160\"," \
244 "\"appV\":\"v1.0.0-development\"" \
245 "}," \
246 "\"ts\":1563968747123" \
247 "}" \
248 "]"
249
250#define TEST_VALIDATE_ARRAY_UI_JSON_SCHEMA \
251 "[" \
252 "{" \
253 "\"v\":1," \
254 "\"ts\":1563968747123" \
255 "}" \
256 "]"
257
258#define TEST_VALIDATE_ARRAY_IMPACT_JSON_SCHEMA \
259 "[" \
260 "{" \
261 "\"v\":300," \
262 "\"ts\":1563968747123" \
263 "}" \
264 "]"
265
266#define TEST_VALIDATE_CONFIGURATION_JSON_SCHEMA \
267 "{" \
268 "\"cfg\":{" \
269 "\"act\":false," \
270 "\"loct\":60," \
271 "\"actwt\":120," \
272 "\"mvres\":120," \
273 "\"mvt\":3600," \
274 "\"accath\":10," \
275 "\"accith\":5," \
276 "\"accito\":80," \
277 "\"nod\":[" \
278 "\"gnss\"," \
279 "\"ncell\"" \
280 "]" \
281 "}" \
282 "}"
283
284#define TEST_VALIDATE_BATCH_JSON_SCHEMA \
285 "{" \
286 "\"bat\":[" \
287 "{" \
288 "\"v\":3600," \
289 "\"ts\":1563968747123" \
290 "}," \
291 "{" \
292 "\"v\":3600," \
293 "\"ts\":1563968747123" \
294 "}" \
295 "]," \
296 "\"btn\":[" \
297 "{" \
298 "\"v\":1," \
299 "\"ts\":1563968747123" \
300 "}," \
301 "{" \
302 "\"v\":1," \
303 "\"ts\":1563968747123" \
304 "}" \
305 "]," \
306 "\"impact\":[" \
307 "{" \
308 "\"v\":300," \
309 "\"ts\":1563968747123" \
310 "}," \
311 "{" \
312 "\"v\":300," \
313 "\"ts\":1563968747123" \
314 "}" \
315 "]," \
316 "\"gnss\":[" \
317 "{" \
318 "\"v\":{" \
319 "\"lat\":62," \
320 "\"lng\":10," \
321 "\"acc\":24," \
322 "\"alt\":170," \
323 "\"spd\":1," \
324 "\"hdg\":176" \
325 "}," \
326 "\"ts\":1563968747123" \
327 "}," \
328 "{" \
329 "\"v\":{" \
330 "\"lat\":62," \
331 "\"lng\":10," \
332 "\"acc\":24," \
333 "\"alt\":170," \
334 "\"spd\":1," \
335 "\"hdg\":176" \
336 "}," \
337 "\"ts\":1563968747123" \
338 "}" \
339 "]," \
340 "\"env\":[" \
341 "{" \
342 "\"v\":{" \
343 "\"temp\":23," \
344 "\"hum\":50," \
345 "\"atmp\":80," \
346 "\"bsec_iaq\":50" \
347 "}," \
348 "\"ts\":1563968747123" \
349 "}," \
350 "{" \
351 "\"v\":{" \
352 "\"temp\":23," \
353 "\"hum\":50," \
354 "\"atmp\":101," \
355 "\"bsec_iaq\":55" \
356 "}," \
357 "\"ts\":1563968747123" \
358 "}" \
359 "]," \
360 "\"roam\":[" \
361 "{" \
362 "\"v\":{" \
363 "\"band\":3," \
364 "\"nw\":\"NB-IoT\"," \
365 "\"rsrp\":-8," \
366 "\"area\":12," \
367 "\"mccmnc\":24202," \
368 "\"cell\":33703719," \
369 "\"ip\":\"10.81.183.99\"" \
370 "}," \
371 "\"ts\":1563968747123" \
372 "}," \
373 "{" \
374 "\"v\":{" \
375 "\"band\":20," \
376 "\"nw\":\"LTE-M\"," \
377 "\"rsrp\":-5," \
378 "\"area\":12," \
379 "\"mccmnc\":24202," \
380 "\"cell\":33703719," \
381 "\"ip\":\"10.81.183.99\"" \
382 "}," \
383 "\"ts\":1563968747123" \
384 "}" \
385 "]," \
386 "\"dev\":[" \
387 "{" \
388 "\"v\":{" \
389 "\"imei\":\"352656106111232\"," \
390 "\"iccid\":\"89450421180216211234\"," \
391 "\"modV\":\"mfw_nrf9160_1.2.3\"," \
392 "\"brdV\":\"nrf9160dk_nrf9160\"," \
393 "\"appV\":\"v1.0.0-development\"" \
394 "}," \
395 "\"ts\":1563968747123" \
396 "}," \
397 "{" \
398 "\"v\":{" \
399 "\"imei\":\"352656106111232\"," \
400 "\"iccid\":\"89450421180216211234\"," \
401 "\"modV\":\"mfw_nrf9160_1.2.3\"," \
402 "\"brdV\":\"nrf9160dk_nrf9160\"," \
403 "\"appV\":\"v1.0.0-development\"" \
404 "}," \
405 "\"ts\":1563968747123" \
406 "}" \
407 "]" \
408 "}"