-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcard.attn.req.notecard.api.json
More file actions
391 lines (391 loc) · 15.4 KB
/
Copy pathcard.attn.req.notecard.api.json
File metadata and controls
391 lines (391 loc) · 15.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/blues/notecard-schema/master/card.attn.req.notecard.api.json",
"title": "card.attn Request Application Programming Interface (API) Schema",
"description": "Configure hardware notifications from a Notecard to a host MCU.\n\n_**NOTE:** Requires a connection between the Notecard ATTN pin and a GPIO pin on the host MCU._",
"type": "object",
"version": "1.1.2",
"apiVersion": "9.1.1",
"skus": [
"CELL",
"CELL+WIFI",
"LORA",
"SKYLO",
"WIFI"
],
"properties": {
"files": {
"description": "A list of [Notefiles](https://dev.blues.io/api-reference/glossary/#notefile) to watch for file-based interrupts.",
"type": "array",
"items": {
"type": "string",
"pattern": "^.+\\.(qo|qi|db|dbs)$"
},
"minItems": 1
},
"mode": {
"description": "A comma-separated list of one or more of the following keywords. Some keywords are only supported on certain types of Notecards.",
"type": "string",
"pattern": "^(?:-all|-env|-files|-location|-motion|-usb|arm|auxgpio|connected|disarm|env|files|location|motion|motionchange|rearm|signal|sleep|usb|watchdog|wireless)(?:,\\s*(?:-all|-env|-files|-location|-motion|-usb|arm|auxgpio|connected|disarm|env|files|location|motion|motionchange|rearm|signal|sleep|usb|watchdog|wireless))*\\s*$",
"sub-descriptions": [
{
"const": "",
"description": "Queries the current ATTN pin state.",
"skus": [
"CELL",
"CELL+WIFI",
"SKYLO",
"WIFI"
]
},
{
"const": "arm",
"description": "Clear \"files\" events and cause the ATTN pin to go LOW. After an event occurs or \"seconds\" has elapsed, the ATTN pin will then go HIGH (a.k.a. \"fires\"). If \"seconds\" is 0, no timeout will be scheduled. If ATTN is armed, calling `arm` again will disarm (briefly pulling ATTN HIGH), then arm (non-idempotent).",
"skus": [
"CELL",
"CELL+WIFI",
"LORA",
"SKYLO",
"WIFI"
]
},
{
"const": "auxgpio",
"description": "When armed, causes ATTN to fire if an AUX GPIO input changes. Disable by using `-auxgpio`.",
"skus": [
"CELL",
"CELL+WIFI",
"LORA",
"SKYLO",
"WIFI"
],
"minApiVersion": "3.4.1"
},
{
"const": "connected",
"description": "When armed, will cause ATTN to fire whenever the module connects to cellular. Disable with `-connected`.",
"skus": [
"CELL",
"CELL+WIFI",
"SKYLO",
"WIFI"
]
},
{
"const": "disarm",
"description": "Causes ATTN pin to go HIGH if it had been LOW.\n\nPassing both `\"disarm\"` and `\"-all\"` clears all ATTN monitors currently set.",
"skus": [
"CELL",
"CELL+WIFI",
"LORA",
"SKYLO",
"WIFI"
],
"minApiVersion": "3.2.1"
},
{
"const": "env",
"description": "When armed, causes ATTN to fire if an environment variable changes on the Notecard. Disable by using `-env`.",
"skus": [
"CELL",
"CELL+WIFI",
"LORA",
"SKYLO",
"WIFI"
],
"minApiVersion": "3.4.1"
},
{
"const": "files",
"description": "When armed, will cause ATTN to fire if any of the \"files\" are modified. Disable by using `-files`.",
"skus": [
"CELL",
"CELL+WIFI",
"LORA",
"SKYLO",
"WIFI"
]
},
{
"const": "location",
"description": "When armed, will cause ATTN to fire whenever the Notecard GPS module makes a position fix. Disable by using `-location`.",
"skus": [
"CELL",
"CELL+WIFI",
"SKYLO",
"WIFI"
]
},
{
"const": "motion",
"description": "When armed, will cause ATTN to fire whenever the accelerometer detects module motion. Disable with `-motion`.",
"skus": [
"CELL",
"CELL+WIFI",
"SKYLO",
"WIFI"
]
},
{
"const": "motionchange",
"description": "When armed, will cause ATTN to fire whenever the `card.motion.mode` changes from \"moving\" to \"stopped\" (or vice versa). Learn how to configure this feature [in this guide](https://dev.blues.io/guides-and-tutorials/notecard-guides/asset-tracking-with-gps/#wake-host-or-send-note-on-motion-status-change).",
"skus": [
"CELL",
"CELL+WIFI",
"SKYLO",
"WIFI"
],
"minApiVersion": "6.1.1"
},
{
"const": "rearm",
"description": "Will arm ATTN if not already armed. Otherwise, resets the values of `mode`, `files`, and `seconds` specified in the initial `arm` or `rearm` request (idempotent).",
"skus": [
"CELL",
"CELL+WIFI",
"SKYLO",
"WIFI"
]
},
{
"const": "signal",
"description": "When armed, will cause ATTN to fire whenever the Notecard receives a [signal](https://dev.blues.io/api-reference/glossary/#signal).",
"skus": [
"CELL",
"CELL+WIFI",
"SKYLO",
"WIFI"
]
},
{
"const": "sleep",
"description": "Instruct the Notecard to pull the ATTN pin low for a period of time, and optionally keep a payload in memory. Can be used by the host to sleep the host MCU.",
"skus": [
"CELL",
"CELL+WIFI",
"SKYLO",
"WIFI"
]
},
{
"const": "usb",
"description": "When armed, will enable USB power events firing the ATTN pin. Disable with `-usb`.",
"skus": [
"CELL",
"CELL+WIFI",
"LORA",
"SKYLO",
"WIFI"
]
},
{
"const": "watchdog",
"description": "Not an \"arm\" mode, rather will cause the ATTN pin to go from HIGH to LOW, then HIGH if the notecard fails to receive any JSON requests for \"seconds.\" In this mode, \"seconds\" must be >= 60.",
"skus": [
"CELL",
"CELL+WIFI",
"SKYLO",
"WIFI"
]
},
{
"const": "wireless",
"description": "Instruct the Notecard to fire the ATTN pin whenever the `card.wireless` [status](https://dev.blues.io/api-reference/notecard-api/card-requests/#card-wireless) changes.",
"skus": [
"CELL",
"CELL+WIFI",
"SKYLO",
"WIFI"
]
}
]
},
"off": {
"description": "When `true`, completely disables ATTN processing and sets the pin OFF. This setting is retained across device restarts.",
"type": "boolean",
"minApiVersion": "7.2.1"
},
"on": {
"description": "When `true`, enables ATTN processing. This setting is retained across device restarts.",
"type": "boolean"
},
"payload": {
"description": "When using `sleep` mode, a payload of data from the host that the Notecard should hold in memory until retrieved by the host.",
"type": "string",
"format": "binary",
"contentEncoding": "base64"
},
"seconds": {
"description": "To set an ATTN timeout when arming, or when using `sleep`.\n\n_**NOTE:** When the Notecard is in `continuous` mode, the `seconds` timeout is serviced by a routine that wakes every 15 seconds. You can predict when the device will wake, by rounding up to the nearest 15 second interval._",
"type": "integer",
"minimum": -1
},
"start": {
"description": "When using `sleep` mode and the host has reawakened, request the Notecard to return the stored `payload`.",
"type": "boolean"
},
"verify": {
"description": "When `true`, returns the current attention mode configuration, if any.",
"type": "boolean",
"minApiVersion": "3.2.1"
},
"req": {
"description": "Request for the Notecard (expects response)",
"const": "card.attn"
},
"cmd": {
"description": "Command for the Notecard (no response)",
"const": "card.attn"
}
},
"oneOf": [
{
"required": [
"req"
],
"properties": {
"req": {
"const": "card.attn"
}
}
},
{
"required": [
"cmd"
],
"properties": {
"cmd": {
"const": "card.attn"
}
}
}
],
"unevaluatedProperties": false,
"allOf": [
{
"if": {
"properties": {
"mode": {
"type": "string",
"pattern": "(^watchdog$|^watchdog,|,*\\s*watchdog\\s*,|,*\\s*watchdog$)"
}
},
"required": [
"mode"
]
},
"then": {
"properties": {
"seconds": {
"minimum": 60
}
},
"required": [
"seconds"
]
},
"else": {
"if": {
"properties": {
"mode": {
"type": "string",
"pattern": "(^sleep$|^sleep,|,*\\s*sleep\\s*,|,*\\s*sleep$)"
}
},
"required": [
"mode"
]
},
"then": {
"properties": {
"seconds": {
"minimum": -1
}
},
"required": [
"seconds"
]
},
"else": {
"not": {
"required": [
"seconds"
]
}
}
}
},
{
"if": {
"properties": {
"mode": {
"type": "string",
"pattern": "(^files$|^files,|,*\\s*files\\s*,|,*\\s*files$)"
}
},
"required": [
"mode"
]
},
"then": {
"required": [
"files"
]
},
"else": {
"not": {
"required": [
"files"
]
}
}
}
],
"samples": [
{
"title": "Connected",
"description": "Configure the Notecard to perform an interrupt on a successful connection to Notehub.",
"json": "{\"req\":\"card.attn\",\"mode\":\"arm,connected\"}"
},
{
"title": "Files",
"description": "Configure the Notecard to perform an interrupt on the `data.qi` and `my-settings.db` Notefiles.",
"json": "{\"req\":\"card.attn\",\"mode\":\"arm,files\",\"files\":[\"data.qi\",\"my-settings.db\"]}"
},
{
"title": "Location",
"description": "Configure the Notecard to perform an interrupt when the Notecard makes a position fix.",
"json": "{\"req\":\"card.attn\",\"mode\":\"arm,location\"}"
},
{
"title": "Motion",
"description": "Configure the Notecard to perform an interrupt when the Notecard detects motion.",
"json": "{\"req\":\"card.attn\",\"mode\":\"arm,motion\"}"
},
{
"title": "Signal",
"description": "Configure the Notecard to perform an interrupt when the Notecard receives a signal.",
"json": "{\"req\":\"card.attn\",\"mode\":\"arm,signal\"}"
},
{
"title": "Watchdog",
"description": "Configure the Notecard to function as a watchdog timer with a 60 second timeout.",
"json": "{\"req\":\"card.attn\",\"mode\":\"watchdog\",\"seconds\":60}"
},
{
"title": "Sleep With Payload",
"description": "Configure the Notecard to instruct the host MCU to sleep for a period of time.",
"json": "{\"req\":\"card.attn\",\"mode\":\"sleep\",\"seconds\":3600,\"payload\":\"ewogICJpbnRlcnZhbHMiOiI2MCwxMiwxNCIKfQ==\"}"
},
{
"title": "Retrieve Payload",
"description": "Retrieve a payload from the Notecard after sleep.",
"json": "{\"req\":\"card.attn\",\"start\":true}"
},
{
"title": "Disarm all Modes",
"description": "Disarm all interrupts.",
"json": "{\"req\":\"card.attn\",\"mode\":\"disarm,-all\"}"
}
]
}