-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlynkNCP.jidl
335 lines (329 loc) · 9.11 KB
/
BlynkNCP.jidl
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
{
"module": "Blynk.NCP",
"@version": "0.6.4",
"@author": "Volodymyr Shymanskyy",
"@license": "Apache-2.0",
"@output_dir": "./src/idl",
"interfaces" : {
"ncp": {
"@id": 1,
"ping": {
"@attrs": [ "no_impl", "c:ret_status" ],
"@timeout": 100
},
"reboot": { "returns": "Bool" },
"hasUID": {
"@doc" : "Checks if UID is implemented",
"args": [ { "uid": "UInt16" } ],
"returns": "Bool"
}
},
"mcu": {
"@id": 1,
"ping": {
"@attrs": [ "no_impl", "c:ret_status" ],
"@timeout": 100
},
"reboot": { "returns": "Bool" },
"hasUID": {
"@doc" : "Checks if UID is implemented",
"args": [ { "uid": "UInt16" } ],
"returns": "Bool"
}
},
"hw": {
"@id": 2,
"setUartBaudRate": {
"args": [ { "baud": "UInt32" } ],
"returns": "Bool",
"@c:error_val": false
},
"initUserButton": {
"args": [
{ "gpio": "UInt16" },
{ "active_low": "Bool" }
],
"returns": "Bool"
},
"initLED": {
"@doc" : "Initialize a monochrome LED state indicator",
"args": [
{ "gpio": "UInt16" },
{ "active_low": "Bool" }
],
"returns": "Bool"
},
"initRGB": {
"@doc" : "Initialize an RGB state indicator",
"args": [
{ "gpio_r": "UInt16" },
{ "gpio_g": "UInt16" },
{ "gpio_b": "UInt16" },
{ "common_anode": "Bool" }
],
"returns": "Bool"
},
"initARGB": {
"@doc" : "Initialize an addressable RGB state indicator",
"args": [
{ "gpio": "UInt16" },
{ "mode": "UInt8" },
{ "count": "UInt8" }
],
"returns": "Bool"
},
"setLedBrightness": {
"args": [ { "value": "UInt8" } ],
"returns": "Bool"
},
"getWiFiMAC": {
"args": [ { "mac": "String", "@dir": "out" } ],
"returns": "Bool"
},
"getEthernetMAC": {
"args": [ { "mac": "String", "@dir": "out" } ],
"returns": "Bool"
}
},
"blynk": {
"@id": 3,
"getNcpVersion": {
"args": [ { "ver": "String", "@dir": "out" } ],
"returns": "Bool"
},
"setVendorPrefix": {
"args": [ { "vendor": "String" } ],
"returns": "Bool"
},
"setVendorServer": {
"args": [ { "host": "String" } ],
"returns": "Bool"
},
"setFirmwareInfo": {
"args": [
{ "type": "String" },
{ "version": "String" },
{ "build": "String" },
{ "blynk": "String" }
],
"returns": "Bool"
},
"initialize": {
"@timeout": 5000,
"args": [
{ "templateID": "String" },
{ "templateName": "String" }
],
"returns": "Bool"
},
"getHotspotName": {
"@doc": "Device name that is broadcasted during the configuration process",
"args": [ { "hotspot": "String", "@dir": "out" } ],
"returns": "Bool"
},
"isConfigured": {
"@doc": "Check if NCP has all the required configuration to try connecting to the Cloud",
"returns": "Bool"
},
"configStart": {
"@doc": "Enter configuration mode",
"returns": "Bool"
},
"configStop": {
"@doc": "Exit configuration mode",
"returns": "Bool"
},
"configReset": {
"@doc": "Erase Blynk Cloud configuration",
"returns": "Bool"
},
"setConfigTimeout": {
"@doc": "Configuration mode timeout. Default: 180 seconds",
"args": [ { "timeout": "UInt16" } ],
"returns": "Bool"
},
"setConfigSkipLimit": {
"@doc": "If configuration is skipped N times, device won't automatically enter configuration mode. Configuration reset is required to enter the configuration mode again. Default: 10 times",
"args": [ { "count": "UInt8" } ],
"returns": "Bool"
},
"setTime": {
"@doc": "Initialize NCP time from an external time source",
"args": [
{ "time": "Int64", "@doc": "Current time in milliseconds elapsed since the UNIX epoch" }
],
"returns": "Bool"
},
"getTime": {
"args": [
{ "iso8601": "String", "@dir": "out" },
{ "time": "Int64", "@dir": "out", "@doc": "Current time in milliseconds elapsed since the UNIX epoch" },
{ "offset": "Int16", "@dir": "out", "@doc": "Local time offset in minutes, including DST" },
{ "tz_abbr": "String", "@dir": "out", "@doc": "Timezone abbreviation" },
{ "dst_status": "UInt8", "@dir": "out", "@doc": "0 - No information, 1 - Not Applicable, 2 - Active, 3 - Inactive" }
],
"returns": "Bool"
},
"getLocationInfo": {
"args": [
{ "lat": "String", "@dir": "out", "@doc": "Approximate GPS latitude" },
{ "lon": "String", "@dir": "out", "@doc": "Approximate GPS longitude" },
{ "olson_id": "String", "@dir": "out", "@doc": "OLSON timezone id" },
{ "posix_tz": "String", "@dir": "out", "@doc": "POSIX timezone rule" }
],
"returns": "Bool"
},
"otaUpdateStart": {
"args": [ { "chunk": "UInt16" } ],
"returns": "Bool"
},
"otaUpdateGetCRC32": {
"args": [ { "crc": "UInt32", "@dir": "out" } ],
"returns": "Bool"
},
"otaUpdateGetMD5": {
"args": [ { "digest": "Binary", "@dir": "out" } ],
"returns": "Bool"
},
"otaUpdateGetSHA256": {
"args": [ { "digest": "Binary", "@dir": "out" } ],
"returns": "Bool"
},
"otaUpdatePrefetch": {
"@doc": "Prefetch the firmware file, to reduce the risk of download failure",
"@timeout": 30000,
"returns": "UInt8"
},
"otaUpdateSuspend": {
"@doc": "Suspend OTA during important operations",
"args": [
{ "timeout": "UInt16", "@doc": "Timeout in seconds, max 18 hours. Specify 0 to resume OTA" }
],
"returns": "Bool"
},
"factoryReset": {
"@doc": "Erase all configuration and reboot",
"returns": "Bool"
},
"factoryTestWiFiAP": {
"@doc": "Start a SoftAP on the specified channel for the frequency test",
"@timeout": 5000,
"args": [
{ "channel": "UInt16" }
],
"returns": "UInt8"
},
"factoryTestWiFi": {
"@timeout": 30000,
"args": [
{ "ssid": "String" },
{ "pass": "String" },
{ "rssi": "Int16", "@dir": "out" }
],
"returns": "UInt8"
},
"factoryTestConnect": {
"@doc": "Test connection to the default server",
"@timeout": 10000,
"returns": "UInt8"
},
"getState": {
"returns": "UInt8"
},
"virtualWrite": {
"@oneway": true,
"args": [
{ "vpin": "UInt16" },
{ "value": "Binary" }
]
},
"setProperty": {
"@oneway": true,
"args": [
{ "vpin": "UInt16" },
{ "property": "String" },
{ "value": "Binary" }
]
},
"syncAll": {
"@oneway": true
},
"syncVirtual": {
"@oneway": true,
"args": [ { "vpins": "Binary" } ]
},
"logEvent": {
"@oneway": true,
"args": [
{ "event_code": "String" },
{ "description": "String" }
]
},
"resolveEvent": {
"@oneway": true,
"args": [ { "event_code": "String" } ]
},
"resolveAllEvents": {
"@oneway": true,
"args": [ { "event_code": "String" } ]
},
"beginGroup": {
"@oneway": true,
"args": [ { "timestamp": "Int64" } ]
},
"endGroup": {
"@oneway": true
},
"setMetadata": {
"@oneway": true,
"args": [
{ "field": "String" },
{ "value": "String" }
]
}
},
"client": {
"@id": 4,
"blynkVPinChange": {
"@oneway": true,
"args": [
{ "vpin": "UInt16" },
{ "param": "Binary" }
]
},
"blynkStateChange": {
"@oneway": true,
"args": [ { "state": "UInt8" } ]
},
"processEvent": {
"@oneway": true,
"args": [ { "event": "UInt8" } ]
},
"otaUpdateAvailable": {
"@timeout": 5000,
"args": [
{ "filename": "String" },
{ "filesize": "UInt32" },
{ "fw_type": "String" },
{ "fw_ver": "String" },
{ "fw_build": "String" }
],
"returns": "Bool"
},
"otaUpdateWrite": {
"@timeout": 5000,
"args": [
{ "offset": "UInt32" },
{ "chunk": "Binary" },
{ "crc32": "UInt32" }
],
"returns": "Bool"
},
"otaUpdateFinish": {
"@timeout": 5000,
"returns": "Bool"
},
"otaUpdateCancel": {}
}
}
}