Commit 96b6bb79dc421d3471add69882bf72b52911d384
1 parent
fa64b4a9
增加B200W通讯协议英文版
Showing
1 changed file
with
2014 additions
and
0 deletions
Communication protocol-B200W-MQTT Protocol.md
0 → 100644
1 | + | |
2 | +# SunVote B200W MQTT Communication Protocol | |
3 | + | |
4 | + | |
5 | + | |
6 | + | |
7 | + | |
8 | + | |
9 | + | |
10 | +## MQTT server preparation | |
11 | + | |
12 | +MQTT server requirements: | |
13 | + | |
14 | +Manufacturers use <a href="https://www.emqx.io/get-started" target="_blank" >EMQX </a> for testing | |
15 | + | |
16 | +Able to send and receive MQTT data normally. | |
17 | + | |
18 | +The performance parameters of the server are determined by the business. | |
19 | + | |
20 | +domain name: | |
21 | + | |
22 | +Public network domain name or IP or LAN IP where the base station is located. | |
23 | + | |
24 | +Check the MQTT server configuration results | |
25 | + | |
26 | +Use the MQTT.FX client to configure the domain name, port, username and password information, and then connect. If the connection is successful, it means that the MQTT server is available. The base station clientid is the base station number. | |
27 | + | |
28 | + | |
29 | + | |
30 | + | |
31 | + | |
32 | + | |
33 | +# Function Description | |
34 | + | |
35 | +## Theme Description | |
36 | +\${baseSN}is the SN code of the specified base station and cannot be empty. To receive base station feedback data, you need to subscribe to the receiving topic of the corresponding base station SN. | |
37 | +### Published topics | |
38 | +Topics published by the application to which the base station subscribes <br> | |
39 | +/client/\${baseSN}/send <br> | |
40 | +/client/multiBase/send | |
41 | + | |
42 | +### Subscribed Topics | |
43 | +The topic subscribed by the application, published by the base station <br> | |
44 | +/basestation/\\${baseSN}/receive <br> | |
45 | +/basestation/multiBase/receive | |
46 | + | |
47 | +## Command Description | |
48 | +|Instruction function identifier | Description | Constraints| | |
49 | +|---|---|---| | |
50 | +|get| Get parameter attribute status and data in standby state | Standby state| | |
51 | +|set| Set parameter attribute status and data in standby state | Standby state| | |
52 | +|start| Run a single-process business instance (function) | Standby state| | |
53 | +|stop| Stop a single-process business instance (function) | Standby state| | |
54 | +|rtXXX| Methods and functions can be executed in real time online || | |
55 | + | |
56 | +## Event Description | |
57 | +|Event ID| Description| Constraints| | |
58 | +|---|---|---| | |
59 | +|sEvtXXX|System Event | Auto Return| | |
60 | +|fEvtXXX|Command event | Return after calling the corresponding command| | |
61 | + | |
62 | +## Data format convention | |
63 | +- The data format is unified as **json**, and the MQTT message sending and receiving encoding is unified as **UTF-8** | |
64 | +- The general format of json is as follows: | |
65 | + | |
66 | +```json | |
67 | + { | |
68 | + "fun":"xxx", | |
69 | + "dataTag":"xxx", | |
70 | + "data":{ | |
71 | + //content | |
72 | + } | |
73 | + } | |
74 | +``` | |
75 | + | |
76 | +|Parameters | Description | Constraints| | |
77 | +|---|---|---| | |
78 | +|fun| Command or event name|| | |
79 | +|dataTag| Data tag, used for corresponding sent and received data|Length does not exceed 4, can be a combination of 0-9a-zA-Z| | |
80 | +|data| Data content|Object or array, can be empty| | |
81 | + | |
82 | +**Note: The length of the command data received by the base station at a time does not exceed 2K. When sending a command using a specified keypad, if the command length exceeds the limit, it is recommended to split the command and send it in batches. If the command is executed by all keypad, keySns can be set to an empty array to not use the specified keypad mode** | |
83 | + | |
84 | +## Quick function checking list | |
85 | +### Base Station Management | |
86 | +|Function classification|Function|API command|Command/system event| | |
87 | +|---|---|---|---| | |
88 | +|Base station connection - Get online base station|Actively obtain online base station information<br>When the base station SN is uncertain|[getBsOnlineState](#getbsonlinestate)|[fEvtBsOnlineState](#fevtbsonlinestate)|| | |
89 | +|Base station connection - Actively obtain status|Actively obtain base station connection status|[getBsConnectState](#getbsconnectstate)|[sEvtBsConnectState](#sevtbsconnectstate)|| | |
90 | +|Base station connection - Automatically obtain status|System notification of base station connection changes|-|[sEvtBsConnectState](#sevtbsconnectstate)|| | |
91 | +|Base station timing|Base station timing is used to calibrate time|[timeSync](#timesync)|[sEvtStateCode](#sevtstatecode)|| | |
92 | +|Keypad online notification|Single Keypad online system notification|-|[sEvtBsKpOnlineMsg](#sevtbskponlinemsg)|| | |
93 | +|Identify Settings - Base Station Model|Read Base Station Model|[getBsModel](#getbsmodel)|[fEvtBsModel](#fevtbsmodel)| | |
94 | +|Identify Settings - Firmware Version|Get Base Station Firmware Version|[getBsFWVersion](#getbsfwversion)|[fEvtBsFWVersion](#fevtbsfwversion)| | |
95 | +| Network Settings - Pairing Code|Get base station pairing code|[getBsPairCode](#getbspaircode)|[fEvtBsPairCode](#fevtbspaircode)| | |
96 | +| Network Settings - Card Swipe Pairing Status|Get Card Swipe Pairing Status|[getBsNfcLogin](#getbsnfclogin)|[fEvtBsNfcLogin](#fevtbsnfclogin)| | |
97 | +||Set the card pairing status|[setBsNfcLogin](#setbsnfclogin)|[fEvtBsNfcLogin](#fevtbsnfclogin)|| | |
98 | +|Network Settings - Working Channel|Get base station working channel|[getBsChannel](#getbschannel)|[fEvtBsChannel](#fevtbschannel)| | |
99 | +||Set the base station working channel|[setBsChannel](#setbschannel)|[fEvtBsChannel](#fevtbschannel)|| | |
100 | +|Login Settings - Login Name|Get base station login name|[getBsSSID](#getbsssid)|[fEvtBsSSID](#fevtbsssid)| | |
101 | +||Set the base station login name|[setBsSSID](#setbsssid)|[fEvtBsSSID](#fevtbsssid)|| | |
102 | +|Keypad unified settings - keypad language|Get keypad language|[getBsKpLanguage](#getbskplanguage)|[fEvtBsKpLanguage](#fevtbskplanguage)| | |
103 | +||Set the keypad language|[setBsKpLanguage](#setbskplanguage)|[fEvtBsKpLanguage](#fevtbskplanguage)|| | |
104 | +|Network Settings - TCP/IP Parameters|Get TCP/IP Parameters|[getBsTcpipParams](#getbstcpipparams)|[fEvtBsTcpipParams](#fevtbstcpipparams)| | |
105 | +||Set TCP/IP parameters|[setBsTcpipParams](#setbstcpipparams)|[fEvtBsTcpipParams](#fevtbstcpipparams)|| | |
106 | +|Network Settings - MQTT Parameters|Get MQTT Parameters|[getBsMqttParams](#getbsmqttparams)|[fEvtBsMqttParams](#fevtbsmqttparams)| | |
107 | +||Set MQTT parameters|[setBsMqttParams](#setbsmqttparams)|[fEvtBsMqttParams](#fevtbsmqttparams)|| | |
108 | +|Base station maintenance|Get base station log information|[getBsLogInfo](#getbsloginfo)|[sEvtStateCode](#sevtstatecode)| | |
109 | +### Keypad Management | |
110 | +|Function classification|Function|API command|Command event| | |
111 | +|---|---|---|---| | |
112 | +|Interaction settings - User real-time prompt information|Real-time setting prompt feedback information|[rtSetKpUserPrompt](#rtsetkpuserprompt)|[sEvtStateCode](#sevtstatecode)<br>[fEvtSetKpUserPrompt](#fevtsetkpuserprompt)| | |
113 | +|Get online status|Start scanning online keypad|[startGetKpOnline](#startgetkponline)|[sEvtStateCode](#sevtstatecode)<br>[sEvtBsKpOnlineMsg](#sevtbskponlinemsg)| | |
114 | +||Stop scanning online keypad|[stopGetKpOnline](#stopgetkponline)|[sEvtStateCode](#sevtstatecode)| | |
115 | +|Maintenance function - Remote control function|Remote keypad sleep|[remoteKpSleep](#remotekpsleep)|[sEvtStateCode](#sevtstatecode)| | |
116 | +### Binding | |
117 | +|Function classification|Function|API command|Command event| | |
118 | +|---|---|---|---| | |
119 | +|Wireless binding|Set binding information to keypad|[rtSetKpBindingInfo](#rtsetkpbindinginfo)|[sEvtStateCode](#sevtstatecode)<br>[fEvtKpBindingInfo](#fevtkpbindinginfo)| | |
120 | +||Clear keypad binding information|[clearKpBindingInfo](#clearkpbindinginfo)|[sEvtStateCode](#sevtstatecode)<br>[fEvtClearKpBindingInfo](#fevtclearkpbindinginfo)| | |
121 | +### Sign in | |
122 | +|Function classification|Function|API command|Command event| | |
123 | +|---|---|---|---| | |
124 | +|Sign in at any time|Start signing in at any time|[rtStartKpSignIn](#rtstartkpsignin)|[sEvtStateCode](#sevtstatecode)<br>[fEvtKpSignIn](#fevtkpsignin)| | |
125 | +||Stop signing in anytime|[rtStopKpSignIn](#rtstopkpsignin)|[sEvtStateCode](#sevtstatecode)| | |
126 | +||Real-time PIN Sign-in Authorization|[rtSetKpLoginAllowed](#rtsetkploginallowed)|[sEvtStateCode](#sevtstatecode)<br>[fEvtKpLoginAllowed](#fevtkploginallowed)| | |
127 | +### Key pressing feedback | |
128 | +|Function classification|Function|API command|Command event| | |
129 | +|---|---|---|---| | |
130 | +|True or False|Start the True or False|[startQATrueFalse](#startqatruefalse)|[sEvtStateCode](#sevtstatecode)<br>[fEvtQATrueFalse](#fevtqatruefalse)| | |
131 | +||Stop True or False|[stopQATrueFalse](#stopqatruefalse)|[sEvtStateCode](#sevtstatecode)| | |
132 | +|Multiple Choices|Start Multiple Choices|[startQAChoice](#startqachoice)|[sEvtStateCode](#sevtstatecode)<br>[fEvtQAChoice](#fevtqachoice)| | |
133 | +||Stop Multiple choices|[stopQAChoice](#stopqachoice)|[sEvtStateCode](#sevtstatecode)| | |
134 | +|Numeric|Start Numeric|[startQANum](#startqanum)|[sEvtStateCode](#sevtstatecode)<br>[fEvtQANum](#fevtqanum)| | |
135 | +||Stop Numeric|[stopQANum](#stopqanum)|[sEvtStateCode](#sevtstatecode)| | |
136 | +|Rush Answer|Start Rush Answer|[startQAQuicker](#startqaquicker)|[sEvtStateCode](#sevtstatecode)<br>[fEvtQAQuicker](#fevtqaquicker)| | |
137 | +||Stop Rush Answer|[stopQAQuicker](#stopqaquicker)|[sEvtStateCode](#sevtstatecode)| | |
138 | +### Online Quiz | |
139 | +|Function classification|Function|API command|Command event| | |
140 | +|---|---|---|---| | |
141 | +|Standard Exam|Start Standard Exam|[startKpExam](#startkpexam)|[sEvtStateCode](#sevtstatecode)<br>[fEvtKpExam](#fevtkpexam)<br>[fEvtFinalSubmit](#fevtfinalsubmit)| | |
142 | +||Stop Standard Exam|[stopKpExam](#stopkpexam)|[sEvtStateCode](#sevtstatecode)| | |
143 | +||Allow keypad submission and rollback|[rtAllowEdited](#rtkpallowedited)|[sEvtStateCode](#sevtstatecode)<br>[fEvtFinalSubmit](#fevtfinalsubmit)| | |
144 | + | |
145 | +## Public Events | |
146 | +### sEvtBsConnectState | |
147 | +- **Subject**: /basestation/\${baseSN}/receive | |
148 | +- **Function description**:Returns the base station model and base station SN when the base station is successfully connected, and returns disconnected when the base station is disconnected from the connected state | |
149 | +- **Parameter Description** | |
150 | + | |
151 | +|Parameter name|Type|Restriction|Not null|Description| | |
152 | +|-----|-----|-----|-----|-----| | |
153 | +|fun|string|-|True|event type| | |
154 | +|dataTag|string|-|False|Data packet tag, an empty string can be passed if not needed| | |
155 | +|data|object|-|True|The object to pass parameters| | |
156 | +|+baseModel|int||False|Base station model number| | |
157 | +|+modelName|string||False|Model name of the base station| | |
158 | +|+state|int||True|The connection status of the base station<br>1-Connected<br>2-Disconnected| | |
159 | +|+version|string||False|Base station firmware version| | |
160 | + | |
161 | +- **Sample Code** | |
162 | + | |
163 | +```json | |
164 | +//Connected | |
165 | +{ | |
166 | + "fun":"sEvtBsConnectState", | |
167 | + "dataTag":"1", | |
168 | + "data":{ | |
169 | + "state":1, | |
170 | + "baseModel":218, | |
171 | + "modelName":"B200", | |
172 | + "version":"1.0.3" | |
173 | + } | |
174 | +} | |
175 | +//Disconnected | |
176 | +{ | |
177 | + "fun":"sEvtBsConnectState", | |
178 | + "dataTag":"1", | |
179 | + "data":{ | |
180 | + "state":2 | |
181 | + } | |
182 | +} | |
183 | +``` | |
184 | + | |
185 | +### sEvtBsChannelConflict | |
186 | +- **Subject**: /basestation/\${baseSN}/receive | |
187 | +- **Function description**:Actively report when base station channels conflict, and the application can modify the base station channels according to actual case | |
188 | +- **Parameter Description** | |
189 | + | |
190 | +|Parameter name|Type|Restriction|Not null|Description| | |
191 | +|---|---|---|---|---| | |
192 | +|fun|string|-|True|event name| | |
193 | +|dataTag|string|-|False|Data packet tag, an empty string can be passed if not needed| | |
194 | +|data|object|-|True|The object to pass parameters| | |
195 | +|+value|int||True|the conflicting channel| | |
196 | + | |
197 | +- **Sample Code** | |
198 | + | |
199 | +```json | |
200 | +{ | |
201 | + "fun":"sEvtBsChannelConflict", | |
202 | + "dataTag":"1", | |
203 | + "data":{ | |
204 | + "value":5 //Channel 5 is used by multiple base stations | |
205 | + } | |
206 | +} | |
207 | +``` | |
208 | + | |
209 | +### sEvtBsNfcResults | |
210 | +- **Subject**: /basestation/\${baseSN}/receive | |
211 | +- **Function description**: Actively report when swiping the card with the keypad, and report failure if the capacity of the base station is exceeded | |
212 | +- **Parameter Description** | |
213 | + | |
214 | +|Parameter name|Type|Restriction|Not null|Description| | |
215 | +|---|---|---|---|---| | |
216 | +|fun|string|-|True|event name| | |
217 | +|dataTag|string|-|False|Data packet tag, an empty string can be passed if not needed| | |
218 | +|data|object|-|True|The object to pass parameters| | |
219 | +|+keySn|string||True|Keypad SN that swipping card| | |
220 | +|+value|int||True|the status of the card swipe<br>1-success<br>2-failure| | |
221 | + | |
222 | +- **Sample Code** | |
223 | + | |
224 | +```json | |
225 | +{ | |
226 | + "fun":"sEvtBsNfcResults", | |
227 | + "dataTag":"1", //an empty string can be passed if not needed| | |
228 | + "data":{ | |
229 | + "keySn":"1234567890", | |
230 | + "value":1 | |
231 | + } | |
232 | +} | |
233 | +``` | |
234 | + | |
235 | +### sEvtBsKpOnlineMsg | |
236 | +- **Subject**: /basestation/\${baseSN}/receive | |
237 | +- **Function description**: Keypad online notification, active reporting, and also reporting after successful keypad upgrade | |
238 | +- **Parameter Description** | |
239 | + | |
240 | +|Parameter name|Type|Restriction|Not null|Description| | |
241 | +|---|---|---|---|---| | |
242 | +|fun|string|-|True|event name| | |
243 | +|dataTag|string|-|False|packet tag| | |
244 | +|data|object|-|True|The object to pass parameters| | |
245 | +|+keySn|string||True|Keypad SN| | |
246 | +|+version|string||True|Keypad Firmware Version| | |
247 | +|+model|int||True|Keypad model| | |
248 | +|+voltage|double||True|Keypad voltage| | |
249 | + | |
250 | +- **Sample Code** | |
251 | + | |
252 | +```json | |
253 | +{ | |
254 | + "fun":"sEvtBsKpOnlineMsg", | |
255 | + "dataTag":"1", | |
256 | + "data":{ | |
257 | + "keySn":"1234567890", | |
258 | + "version":"1.0.0", | |
259 | + "model":67, | |
260 | + "voltage":2.8 | |
261 | + } | |
262 | +} | |
263 | +``` | |
264 | + | |
265 | +### sEvtStateCode | |
266 | +- **Subject**: /basestation/\${baseSN}/receive | |
267 | +- **Function description**: Return the status information of base station receiving command | |
268 | +- **Parameter Description** | |
269 | + | |
270 | +|Parameter name|Type|Restriction|Not null|Description| | |
271 | +|---|---|---|---|---| | |
272 | +|fun|string|-|True|event name| | |
273 | +|dataTag|string|-|False|packet tag| | |
274 | +|data|object|-|True|The object to pass parameters| | |
275 | +|+funName|string||True|Command name| | |
276 | +|+code|string||True|Status code, see table below about the meaning| | |
277 | + | |
278 | +|Status Code|Description| | |
279 | +|---|---| | |
280 | +|0|Command received successfully| | |
281 | +|10001|JSON data cannot be parsed correctly| | |
282 | +|10002|Error parsing JSON| | |
283 | +|20001|Base station not connected| | |
284 | +|20002|Function not supported| | |
285 | +|20003|The base station SN format is incorrect| | |
286 | +|20004|Parameter error| | |
287 | +|20005|Base station is answering questions| | |
288 | +|40001|The upgrade function can only support one base station| | |
289 | +|50001|This function must specify a base station| | |
290 | +|60001|Keypad SN must be specified for this function| | |
291 | + | |
292 | +- **Sample Code** | |
293 | + | |
294 | +```json | |
295 | +{ | |
296 | + "fun":"sEvtStateCode", | |
297 | + "dataTag":"1", | |
298 | + "data":{ | |
299 | + "funName":"startKpRollCall", | |
300 | + "code":"20005" | |
301 | + } | |
302 | +} | |
303 | +``` | |
304 | + | |
305 | +## Base Station Management | |
306 | + | |
307 | +### Base station connection | |
308 | + | |
309 | +#### Method | |
310 | + | |
311 | +##### getBsOnlineState | |
312 | +- **Subject**:<span class="yellowFill">/client/multiBase/send</span> | |
313 | +- **Function description**: Actively obtain all online base station information, online base station reply | |
314 | +- **Parameter Description** | |
315 | + | |
316 | +|Parameter name|Type|Restriction|Required|Description| | |
317 | +|---|---|---|---|---| | |
318 | +|fun|string|-|True|Fixed command name| | |
319 | +|dataTag|string|-|False|data packet tag| | |
320 | +- **Sample Code** | |
321 | + | |
322 | +```json | |
323 | +{ | |
324 | + "fun":"getBsOnlineState", | |
325 | + "dataTag":"1" | |
326 | +} | |
327 | +``` | |
328 | + | |
329 | +##### getBsConnectState | |
330 | +- **Subject**:/client/\${baseSN}/send | |
331 | +- **Function description**: Actively obtain base station connection status | |
332 | +- **Parameter Description** | |
333 | + | |
334 | +|Parameter name|Type|Restriction|Required|Description| | |
335 | +|---|---|---|---|---| | |
336 | +|fun|string|-|True|Fixed command name| | |
337 | +|dataTag|string|-|False|data packet tag| | |
338 | +- **Sample Code** | |
339 | + | |
340 | +```json | |
341 | +{ | |
342 | + "fun":"getBsConnectState", | |
343 | + "dataTag":"1" | |
344 | +} | |
345 | +``` | |
346 | + | |
347 | +#### event | |
348 | + | |
349 | +##### [sEvtBsConnectState](#sevtbsconnectstate) | |
350 | +See Base Station Connection Change System Notification | |
351 | + | |
352 | +##### fEvtBsOnlineState | |
353 | +- **Subject**: <span class="yellowFill">/basestation/mutilBase/receive</span> | |
354 | +- **Function description**: The base station returns the base station model and base station SN online | |
355 | +- **Parameter Description** | |
356 | + | |
357 | +|Parameter name|Type|Restriction|Not null|Description| | |
358 | +|-----|-----|-----|-----|-----| | |
359 | +|fun|string|-|True|event type| | |
360 | +|dataTag|string|-|False|Data packet tag, an empty string can be passed if not needed| | |
361 | +|data|object|-|True|The object to pass parameters| | |
362 | +|+baseModel|int||False|Base station model number| | |
363 | +|+modelName|string||False|Model name of the base station| | |
364 | +|+version|string||False|Base station firmware version| | |
365 | +|+baseSN|string||False|Base station SN| | |
366 | + | |
367 | +- **Sample Code** | |
368 | + | |
369 | +```json | |
370 | +//Connected | |
371 | +{ | |
372 | + "fun":"fEvtBsOnlineState", | |
373 | + "dataTag":"1", | |
374 | + "data":{ | |
375 | + "baseModel":218, | |
376 | + "modelName":"B200", | |
377 | + "version":"1.0.3", | |
378 | + "baseSN":"2024041401" | |
379 | + } | |
380 | +} | |
381 | +``` | |
382 | + | |
383 | +### Base station timing | |
384 | +#### Method | |
385 | +##### timeSync | |
386 | +- **Subject**:/client/\${baseSN}/send | |
387 | +- **Function description**: Send the current timestamp to the base station for time calibration | |
388 | +- **Parameter Description** | |
389 | + | |
390 | +|Parameter name|Type|Restriction|Required|Description| | |
391 | +|---|---|---|---|---| | |
392 | +|fun|string|-|True|Fixed command name| | |
393 | +|dataTag|string|-|False|Data packet tag| | |
394 | +|data|object|-|True|The object to pass parameters| | |
395 | +|+timeStamp|long ||False|Timestamp of current time| | |
396 | + | |
397 | +- **Sample Code** | |
398 | + | |
399 | +```json | |
400 | +{ | |
401 | + "fun":"timeSync", | |
402 | + "dataTag":"1", | |
403 | + "data":{ | |
404 | + "timeStamp":1718247133290 | |
405 | + } | |
406 | +} | |
407 | +``` | |
408 | + | |
409 | +#### event | |
410 | +##### [sEvtStateCode](#sevtstatecode) | |
411 | +Returns the command reception status | |
412 | + | |
413 | +### Identification Settings | |
414 | +#### method | |
415 | +##### getBsModel | |
416 | +- **Subject**:/client/\${baseSN}/send | |
417 | +- **Function description**: Get base station model | |
418 | +- **Parameter Description** | |
419 | + | |
420 | +|Parameter name|Type|Restriction|Required|Description| | |
421 | +|---|---|---|---|---| | |
422 | +|fun|string|-|True|Command name| | |
423 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
424 | + | |
425 | +-**Sample Code** | |
426 | + | |
427 | +```json | |
428 | +{ | |
429 | + "fun":"getBsModel", | |
430 | + "dataTag":"1" | |
431 | +} | |
432 | +``` | |
433 | + | |
434 | +##### getBsFWVersion | |
435 | +- **Subject**:/client/\${baseSN}/send | |
436 | +- **Function description**: Get base station firmware version | |
437 | +- **Parameter Description** | |
438 | + | |
439 | +|Parameter name|Type|Restriction|Required|Description| | |
440 | +|---|---|---|---|---| | |
441 | +|fun|string|-|True|Command name| | |
442 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
443 | + | |
444 | +- **Sample Code** | |
445 | + | |
446 | +```json | |
447 | +{ | |
448 | + "fun":"getBsFWVersion", | |
449 | + "dataTag":"1" | |
450 | +} | |
451 | +``` | |
452 | + | |
453 | +#### Event | |
454 | +##### fEvtBsSN | |
455 | +- **Subject**: /basestation/\${baseSN}/receive | |
456 | +- **Function description**: Return the factory code of the base station | |
457 | +- **Parameter Description** | |
458 | + | |
459 | +|Parameter name|Type|Restriction|Not null|Description| | |
460 | +|---|---|---|---|---| | |
461 | +|fun|string|-|True|Event name| | |
462 | +|dataTag|string|-|False|Data packet tag| | |
463 | +|data|object|-|True|The object to pass parameters| | |
464 | +|+value|string|-|True|the factory code of the base station| | |
465 | + | |
466 | +- **Sample Code** | |
467 | + | |
468 | +```json | |
469 | +{ | |
470 | + "fun":"fEvtBsSN", | |
471 | + "dataTag":"1", | |
472 | + "data":{ | |
473 | + "value":"2024041201" | |
474 | + } | |
475 | +} | |
476 | +``` | |
477 | + | |
478 | +##### fEvtBsModel | |
479 | +- **Subject**: /basestation/\${baseSN}/receive | |
480 | +- **Function description**: Returns the model of the base station | |
481 | +- **Parameter Description** | |
482 | + | |
483 | +|Parameter name|Type|Restriction|Required|Description| | |
484 | +|---|---|---|---|---| | |
485 | +|fun|string|-|True|Event name| | |
486 | +|dataTag|string|-|False|Data packet tag| | |
487 | +|data|object|-|True|The object to pass parameters| | |
488 | +|+value|string|-|True|the model name of the base station| | |
489 | + | |
490 | +- **Sample Code** | |
491 | + | |
492 | +```json | |
493 | +{ | |
494 | + "fun":"fEvtBsModel", | |
495 | + "dataTag":"1", | |
496 | + "data":{ | |
497 | + "value":"B200" | |
498 | + } | |
499 | +} | |
500 | +``` | |
501 | + | |
502 | +##### fEvtBsFWVersion | |
503 | +- **Subject**: /basestation/\${baseSN}/receive | |
504 | +- **Function description**: Returns the firmware version of the base station | |
505 | +- **Parameter Description** | |
506 | + | |
507 | +|Parameter name|Type|Restriction|Required|Description| | |
508 | +|---|---|---|---|---| | |
509 | +|fun|string|-|True|Event name| | |
510 | +|dataTag|string|-|False|Data packet tag| | |
511 | +|data|object|-|True|The object to pass parameters| | |
512 | +|+value|string||True|The firmware version number of the base station| | |
513 | + | |
514 | +- **Sample Code** | |
515 | + | |
516 | +```json | |
517 | +{ | |
518 | + "fun":"fEvtBsFWVersion", | |
519 | + "dataTag":"1", | |
520 | + "data":{ | |
521 | + "value":"1.0.3" | |
522 | + } | |
523 | +} | |
524 | +``` | |
525 | + | |
526 | +### Network settings | |
527 | +#### Method | |
528 | +##### getBsPairCode | |
529 | +- **Subject**:/client/\${baseSN}/send | |
530 | +- **Function description**: Get base station pairing code | |
531 | +- **Parameter Description** | |
532 | + | |
533 | +|Parameter name|Type|Restriction|Required|Description| | |
534 | +|---|---|---|---|---| | |
535 | +|fun|string|-|True|command name| | |
536 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
537 | + | |
538 | +- **Sample Code** | |
539 | + | |
540 | +```json | |
541 | +{ | |
542 | + "fun":"getBsPairCode", | |
543 | + "dataTag":"1" | |
544 | +} | |
545 | +``` | |
546 | + | |
547 | +##### getBsNfcLogin | |
548 | +- **Subject**:/client/\${baseSN}/send | |
549 | +- **Function description**: Get card pairing status | |
550 | +- **Parameter Description** | |
551 | + | |
552 | + | |
553 | +|Parameter name|Type|Restriction|Required|Description| | |
554 | +|---|---|---|---|---| | |
555 | +|fun|string|-|True|Command name| | |
556 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
557 | + | |
558 | + | |
559 | +- **Sample Code** | |
560 | + | |
561 | +```json | |
562 | +{ | |
563 | + "fun":"getBsNfcLogin", | |
564 | + "dataTag":"1" | |
565 | +} | |
566 | +``` | |
567 | + | |
568 | +##### setBsNfcLogin | |
569 | +- **Subject**:/client/\${baseSN}/send | |
570 | +- **Function description**: Set the base station card swipe pairing status | |
571 | +- **Parameter Description** | |
572 | + | |
573 | +|Parameter name|Type|Restriction|Required|Description| | |
574 | +|---|---|---|---|---| | |
575 | +|fun|string|-|True|Command name| | |
576 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
577 | +|data|object|-|True|The object to pass parameters| | |
578 | +|+value|string|-|True|Set the base station card pairing status<br>0-Close card pairing<br>1-Open card pairing| | |
579 | + | |
580 | +- **Sample Code** | |
581 | + | |
582 | +```json | |
583 | +{ | |
584 | + "fun":"setBsNfcLogin", | |
585 | + "dataTag":"1", | |
586 | + "data":{ | |
587 | + "value":"1" | |
588 | + } | |
589 | +} | |
590 | +``` | |
591 | + | |
592 | +##### getBsChannel | |
593 | +- **Subject**:/client/\${baseSN}/send | |
594 | +- **Function description**: Get base station channel | |
595 | +- **Parameter Description** | |
596 | + | |
597 | +|Parameter name|Type|Restriction|Required|Description| | |
598 | +|---|---|---|---|---| | |
599 | +|fun|string|-|True|Command name| | |
600 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
601 | + | |
602 | +- **Sample Code** | |
603 | + | |
604 | +```json | |
605 | +{ | |
606 | + "fun":"getBsChannel", | |
607 | + "dataTag":"1" | |
608 | +} | |
609 | +``` | |
610 | + | |
611 | +##### setBsChannel | |
612 | +- **Subject**:/client/\${baseSN}/send | |
613 | +- **Function description**: Set base station channel | |
614 | +- **Parameter Description** | |
615 | + | |
616 | +|Parameter name|Type|Restriction|Required|Description| | |
617 | +|---|---|---|---|---| | |
618 | +|fun|string|-|True|Command name| | |
619 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
620 | +|data|object|-|True|The object to pass parameters| | |
621 | +|+value|string|-|True|The base station channel to be set, the range is: 1-80| | |
622 | + | |
623 | +- **Sample Code** | |
624 | + | |
625 | +```json | |
626 | +{ | |
627 | + "fun":"setBsChannel", | |
628 | + "dataTag":"1", | |
629 | + "data":{ | |
630 | + "value":"23" | |
631 | + } | |
632 | +} | |
633 | +``` | |
634 | + | |
635 | +#### Event | |
636 | +##### fEvtBsPairCode | |
637 | +- **Subject**: /basestation/\${baseSN}/receive | |
638 | +- **Function description**: Return base station pairing code | |
639 | +- **Parameter Description** | |
640 | + | |
641 | +|Parameter name|Type|Restriction|Not null|Description| | |
642 | +|---|---|---|---|---| | |
643 | +|fun|string|-|True|Event name| | |
644 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
645 | +|data|object|-|True|The object to pass parameters| | |
646 | +|+value|string||True|The pairing code of the base station| | |
647 | + | |
648 | +- **Sample Code** | |
649 | + | |
650 | +```json | |
651 | +{ | |
652 | + "fun":"fEvtBsPairCode", | |
653 | + "dataTag":"1", | |
654 | + "data":{ | |
655 | + "value":"123456" | |
656 | + } | |
657 | +} | |
658 | +``` | |
659 | + | |
660 | +##### fEvtBsChannel | |
661 | +- **Subject**: /basestation/\${baseSN}/receive | |
662 | +- **Function description**: Return to base station channel | |
663 | +- **Parameter Description** | |
664 | + | |
665 | +|Parameter name|Type|Restriction|Not null|Description| | |
666 | +|---|---|---|---|---| | |
667 | +|fun|string|-|True|Event name| | |
668 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
669 | +|data|object|-|True|The object to pass parameters| | |
670 | +|+value|string||True|Base station channel| | |
671 | + | |
672 | +- **Sample Code** | |
673 | + | |
674 | +```json | |
675 | +{ | |
676 | + "fun":"fEvtBsChannel", | |
677 | + "dataTag":"1", | |
678 | + "data":{ | |
679 | + "value":"5" | |
680 | + } | |
681 | +} | |
682 | +``` | |
683 | + | |
684 | +##### fEvtBsNfcLogin | |
685 | +- **Subject**: /basestation/\${baseSN}/receive | |
686 | +- **Function description**: Returns whether the base station allows NFC card swiping | |
687 | +- **Parameter Description** | |
688 | + | |
689 | +|Parameter name|Type|Restriction|Not null|Description| | |
690 | +|---|---|---|---|---| | |
691 | +|fun|string|-|True|Event name| | |
692 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
693 | +|data|object|-|True|The object to pass parameters| | |
694 | +|+value|string||True|0-off 1-on| | |
695 | + | |
696 | +- **Sample Code** | |
697 | + | |
698 | +```json | |
699 | +{ | |
700 | + "fun":"fEvtBsNfcLogin", | |
701 | + "dataTag":"1", | |
702 | + "data":{ | |
703 | + "value":"1" | |
704 | + } | |
705 | +} | |
706 | +``` | |
707 | + | |
708 | +### Login Settings | |
709 | +#### Method | |
710 | +##### getBsSSID | |
711 | +Get the base station login name | |
712 | +- **Subject**:/client/\${baseSN}/send | |
713 | +- **Function description**: Get the base station login name | |
714 | +- **Parameter Description** | |
715 | + | |
716 | +|Parameter name|Type|Restriction|Required|Description| | |
717 | +|---|---|---|---|---| | |
718 | +|fun|string|-|True|Fixed command name| | |
719 | +|dataTag|string|-|False|Data packet tag| | |
720 | + | |
721 | +- **Sample Code** | |
722 | + | |
723 | +```json | |
724 | +{ | |
725 | + "fun":"getBsSSID", | |
726 | + "dataTag":"1" | |
727 | +} | |
728 | +``` | |
729 | + | |
730 | +##### setBsSSID | |
731 | +- **Subject**:/client/\${baseSN}/send | |
732 | +- **Function description**: Set the base station login name | |
733 | +- **Parameter Description** | |
734 | + | |
735 | +|Parameter name|Type|Restriction|Required|Description| | |
736 | +|---|---|---|---|---| | |
737 | +|fun|string|-|True|Command name| | |
738 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
739 | +|data|object|-|True|The object to pass parameters| | |
740 | +|+value|string||True|The SSID of the base station to be set, with a maximum of 12 characters| | |
741 | + | |
742 | +- **Sample Code** | |
743 | + | |
744 | +```json | |
745 | +{ | |
746 | + "fun":"setBsSSID", | |
747 | + "dataTag":"1", | |
748 | + "data":{ | |
749 | + "value":"Class 1901" | |
750 | + } | |
751 | +} | |
752 | +``` | |
753 | + | |
754 | +#### Event | |
755 | +##### fEvtBsSSID | |
756 | +- **Subject**: /basestation/\${baseSN}/receive | |
757 | +- **Function description**: Return the base station name | |
758 | +- **Parameter Description** | |
759 | + | |
760 | +|Parameter name|Type|Restriction|Not null|Description| | |
761 | +|---|---|---|---|---| | |
762 | +|fun|string|-|True|Event name| | |
763 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
764 | +|data|object|-|True|The object to pass parameters| | |
765 | +|+value|string||True|The base station name| | |
766 | + | |
767 | +- **Sample Code** | |
768 | + | |
769 | +```json | |
770 | +{ | |
771 | + "fun":"fEvtBsSSID", | |
772 | + "dataTag":"1", | |
773 | + "data":{ | |
774 | + "value":"Class 1901" | |
775 | + } | |
776 | +} | |
777 | +``` | |
778 | + | |
779 | +### Keypad unified settings | |
780 | +#### Method | |
781 | +##### getBsKpLanguage | |
782 | +- **Subject**:/client/\${baseSN}/send | |
783 | +- **Function description**: Get Keypad language | |
784 | +- **Parameter Description** | |
785 | + | |
786 | + | |
787 | +|Parameter name|Type|Restriction|Required|Description| | |
788 | +|---|---|---|---|---| | |
789 | +|fun|string|-|True|Command name| | |
790 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
791 | + | |
792 | +- **Sample Code** | |
793 | + | |
794 | +```json | |
795 | +{ | |
796 | + "fun":"getBsKpLanguage", | |
797 | + "dataTag":"1" | |
798 | +} | |
799 | +``` | |
800 | + | |
801 | +##### setBsKpLanguage | |
802 | +- **Subject**:/client/\${baseSN}/send | |
803 | +- **Function description**: Set keypad language | |
804 | +- **Parameter Description** | |
805 | + | |
806 | + | |
807 | +|Parameter name|Type|Restriction|Required|Description| | |
808 | +|---|---|---|---|---| | |
809 | +|fun|string|-|True|Command name| | |
810 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
811 | +|data|object|-|True|The object to pass parameters| | |
812 | +|+value|string||True|Set the language displayed on the Keypad<br>1-Simplified Chinese<br>2-English| | |
813 | + | |
814 | +- **Sample Code** | |
815 | + | |
816 | +```json | |
817 | +{ | |
818 | + "fun":"setBsKpLanguage", | |
819 | + "dataTag":"1", | |
820 | + "data":{ | |
821 | + "value":"1" | |
822 | + } | |
823 | +} | |
824 | +``` | |
825 | + | |
826 | +#### Event | |
827 | +##### fEvtBsKpLanguage | |
828 | +- **Subject**: /basestation/\${baseSN}/receive | |
829 | +- **Function description**: Return keypad language | |
830 | +- **Parameter Description** | |
831 | + | |
832 | +|Parameter name|Type|Restriction|Not null|Description| | |
833 | +|---|---|---|---|---| | |
834 | +|fun|string|-|True|Command name| | |
835 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
836 | +|data|object|-|True|The object to pass parameters| | |
837 | +|+value|string||True|Set the language displayed on the Keypad<br>1-Simplified Chinese<br>2-English| | |
838 | + | |
839 | +- **Sample Code** | |
840 | + | |
841 | +```json | |
842 | +{ | |
843 | + "fun":"fEvtBsKpLanguage", | |
844 | + "dataTag":"1", | |
845 | + "data":{ | |
846 | + "value":"1" | |
847 | + } | |
848 | +} | |
849 | +``` | |
850 | + | |
851 | +### Network parameter settings | |
852 | +#### Method | |
853 | +##### getBsTcpipParams | |
854 | +- **Subject**:/client/\${baseSN}/send | |
855 | +- **Function description**: Get base station TCP/IP parameters | |
856 | +- **Parameter Description** | |
857 | + | |
858 | +|Parameter name|Type|Restriction|Required|Description| | |
859 | +|---|---|---|---|---| | |
860 | +|fun|string|-|True|Command name| | |
861 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
862 | + | |
863 | +- **Sample Code** | |
864 | + | |
865 | +```json | |
866 | +{ | |
867 | + "fun":"getBsTcpipParams", | |
868 | + "dataTag":"1" | |
869 | +} | |
870 | +``` | |
871 | + | |
872 | +##### setBsTcpipParams | |
873 | +- **Subject**:/client/\${baseSN}/send | |
874 | +- **Function description**: Set base station TCP/IP parameters | |
875 | +- **Parameter Description** | |
876 | + | |
877 | +|Parameter name|Type|Restriction|Required|Description| | |
878 | +|---|---|---|---|---| | |
879 | +|fun|string|-|True|Command name| | |
880 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
881 | +|data|object|-|True|The object to pass parameters| | |
882 | +|+ip|string||False|IP Address| | |
883 | +|+mask|string||False|subnet mask| | |
884 | +|+gateway|string||False|Gateway address| | |
885 | +|+ipAllocation|int||False|Base station IP acquisition method<br>0 - Manual assignment<br>1 - DHCP acquisition| | |
886 | + | |
887 | +- **Sample Code** | |
888 | + | |
889 | +```json | |
890 | +{ | |
891 | + "fun":"setBsTcpipParams", | |
892 | + "dataTag":"1", | |
893 | + "data":{ | |
894 | + "ip":"192.168.0.10", | |
895 | + "mask":"255.255.255.0", | |
896 | + "gateway":"192.168.0.1", | |
897 | + "ipAllocation":1 | |
898 | + } | |
899 | +} | |
900 | +``` | |
901 | + | |
902 | +##### getBsMqttParams | |
903 | +- **Subject**:/client/\${baseSN}/send | |
904 | +- **Function description**: Get base station MQTT parameters | |
905 | +- **Parameter Description** | |
906 | + | |
907 | +|Parameter name|Type|Restriction|Required|Description| | |
908 | +|---|---|---|---|---| | |
909 | +|fun|string|-|True|Command name| | |
910 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
911 | + | |
912 | +- **Sample Code** | |
913 | + | |
914 | +```json | |
915 | +{ | |
916 | + "fun":"getBsMqttParams", | |
917 | + "dataTag":"1" | |
918 | +} | |
919 | +``` | |
920 | + | |
921 | +##### setBsMqttParams | |
922 | +- **Subject**:/client/\${baseSN}/send | |
923 | +- **Function description**: Set base station MQTT parameters | |
924 | +- **Parameter Description** | |
925 | + | |
926 | +|Parameter name|Type|Restriction|Required|Description| | |
927 | +|---|---|---|---|---| | |
928 | +|fun|string|-|True|Command name| | |
929 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
930 | +|data|object|-|True|The object to pass parameters| | |
931 | +|+server|string||True|server IP address| | |
932 | +|+port|int||True|Port, default 1883| | |
933 | +|+userName|string||False|Username to connect to the server, optional| | |
934 | +|+password|string||False|Password for connecting to the server, optional| | |
935 | +|+interval|int|>=10|False|The interval for reconnecting after the base station fails to connect to the server, in seconds| | |
936 | + | |
937 | +- **Sample Code** | |
938 | + | |
939 | +```json | |
940 | +{ | |
941 | + "fun":"setBsMqttParams", | |
942 | + "dataTag":"1", | |
943 | + "data":{ | |
944 | + "server":"192.168.10.10", | |
945 | + "port":1883, | |
946 | + "userName":"", | |
947 | + "password":"", | |
948 | + "interval":30 | |
949 | + } | |
950 | +} | |
951 | +``` | |
952 | + | |
953 | +#### Event | |
954 | +##### fEvtBsTcpipParams | |
955 | +- **Subject**: /basestation/\${baseSN}/receive | |
956 | +- **Function description**: Return base station TCP/IP parameters | |
957 | +- **Parameter Description** | |
958 | + | |
959 | +|Parameter name|Type|Restriction|Not null|Description| | |
960 | +|---|---|---|---|---| | |
961 | +|fun|string|-|True|Command name| | |
962 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
963 | +|data|object|-|True|The object to pass parameters| | |
964 | +|+mac|string||True|MAC Address| | |
965 | +|+ip|string||True|IP Address| | |
966 | +|+mask|string||True|Subnet mask| | |
967 | +|+gateway|string||True|Gateway address| | |
968 | +|+ipAllocation|int||False|ase station IP acquisition method<br>0 - Manual assignment<br>1 - DHCP acquisition| | |
969 | + | |
970 | +- **Sample Code** | |
971 | + | |
972 | +```json | |
973 | +{ | |
974 | + "fun":"fEvtBsTcpipParams", | |
975 | + "dataTag":"1", | |
976 | + "data":{ | |
977 | + "mac":"FF:FF:FF:FF:FF:FF", | |
978 | + "ip":"192.168.0.10", | |
979 | + "mask":"255.255.255.0", | |
980 | + "gateway":"192.168.0.1", | |
981 | + "ipAllocation":1 | |
982 | + } | |
983 | +} | |
984 | +``` | |
985 | + | |
986 | +##### fEvtBsMqttParams | |
987 | +- **Subject**: /basestation/\${baseSN}/receive | |
988 | +- **Function description**: Return base station MQTT parameters | |
989 | +- **Parameter Description** | |
990 | + | |
991 | +|Parameter name|Type|Restriction|Not null|Description| | |
992 | +|---|---|---|---|---| | |
993 | +|fun|string|-|True|Command name| | |
994 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
995 | +|data|object|-|True|The object to pass parameters| | |
996 | +|+server|string||True|Server address,IP| | |
997 | +|+port|int||True|Port,default 1883| | |
998 | +|+userName|string||False|Username to connect to the server, optional| | |
999 | +|+password|string||False|Password for connecting to the server, optional| | |
1000 | +|+interval|int|>=10|False|The interval for reconnecting after the base station fails to connect to the server, in seconds| | |
1001 | + | |
1002 | +- **Sample Code** | |
1003 | + | |
1004 | +```json | |
1005 | +{ | |
1006 | + "fun":"fEvtBsMqttParams", | |
1007 | + "dataTag":"1", | |
1008 | + "data":{ | |
1009 | + "server":"192.168.10.10", | |
1010 | + "port":1883, | |
1011 | + "userName":"", | |
1012 | + "password":"", | |
1013 | + "interval":30 | |
1014 | + } | |
1015 | +} | |
1016 | +``` | |
1017 | + | |
1018 | +### Base Station Maintenance | |
1019 | +#### Method | |
1020 | +##### getBsLogInfo | |
1021 | +- **Subject**:/client/\${baseSN}/send | |
1022 | +- **Function description**: Get base station logs, which are used to obtain internal log records of base stations when a fault occurs and needs to be investigated | |
1023 | +- **Parameter Description** | |
1024 | + | |
1025 | +|Parameter name|Type|Restriction|Required|Description| | |
1026 | +|---|---|---|---|---| | |
1027 | +|fun|string|-|True|Command name| | |
1028 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1029 | + | |
1030 | +- **Sample Code** | |
1031 | + | |
1032 | +```json | |
1033 | +{ | |
1034 | + "fun":"getBsLogInfo", | |
1035 | + "dataTag":"1" | |
1036 | +} | |
1037 | +``` | |
1038 | + | |
1039 | +#### Event | |
1040 | +##### [sEvtStateCode](#sevtstatecode) | |
1041 | +Returns the command reception status | |
1042 | + | |
1043 | +## Keypad Management | |
1044 | +### Interaction Settings | |
1045 | +#### Method | |
1046 | +##### rtSetKpUserPrompt | |
1047 | +- **Subject**:/client/\${baseSN}/send | |
1048 | +- **Function description**: Real-time setting prompt feedback information | |
1049 | +- **Parameter Description** | |
1050 | + | |
1051 | +|Parameter name|Type|Restriction|Required|Description| | |
1052 | +|---|---|---|---|---| | |
1053 | +|fun|string|-|True|Command name| | |
1054 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1055 | +|data|array|-|False|The object array to pass parameters| | |
1056 | +|++keySns|array||True|The specified keypad SN array, an empty array represents all online keypads<br><font color="red">Note: Mixing of empty arrays and specified SN arrays is not allowed<br>An empty array defaults to all online keypads, and other specified keypads are invalid</font>| | |
1057 | +|++info|string||False|Feedback information for setting<br>Different keypads can set different feedback information| | |
1058 | + | |
1059 | +- **Sample Code** | |
1060 | + | |
1061 | +```json | |
1062 | +//Respective prompts | |
1063 | +{ | |
1064 | + "fun": "rtSetKpUserPrompt", | |
1065 | + "dataTag":"1", | |
1066 | + "data": [ | |
1067 | + { | |
1068 | + "keySns": ["1479824643","1479824645"], | |
1069 | + "info": "Correct answer" | |
1070 | + }, | |
1071 | + { | |
1072 | + "keySns": ["1479824644"], | |
1073 | + "info": "Wrong answer" | |
1074 | + } | |
1075 | + ] | |
1076 | +} | |
1077 | +//Uniform prompt | |
1078 | +{ | |
1079 | + "fun": "rtSetKpUserPrompt", | |
1080 | + "dataTag":"1", | |
1081 | + "data": [ | |
1082 | + { | |
1083 | + "keySns": [], | |
1084 | + "info": "Question completed" | |
1085 | + } | |
1086 | + ] | |
1087 | +} | |
1088 | +``` | |
1089 | + | |
1090 | +#### Event | |
1091 | +##### [sEvtStateCode](#sevtstatecode) | |
1092 | +Return to receiving status after sending command | |
1093 | + | |
1094 | +##### fEvtSetKpUserPrompt | |
1095 | +- **Subject**:/basestation/\${baseSN}/receive | |
1096 | +- **Function description**: Returns whether the real-time setting prompt is successful | |
1097 | +- **Parameter Description** | |
1098 | + | |
1099 | +|Parameter name|Type|Restriction|Not null|Description| | |
1100 | +|---|---|---|---|---| | |
1101 | +|fun|string|-|True|Command name| | |
1102 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1103 | +|data|array|-|True|The object array to pass parameters| | |
1104 | +|++keySn|string||True|Keypad SN that need to set prompt message| | |
1105 | +|++state|string||True|Whether the prompt message set is successful<br>0 - Success<br>1 - Failure| | |
1106 | + | |
1107 | +- **Sample Code** | |
1108 | + | |
1109 | +```json | |
1110 | +{ | |
1111 | + "fun": "fEvtSetKpUserPrompt", | |
1112 | + "dataTag":"1", | |
1113 | + "data": [ | |
1114 | + { | |
1115 | + "keySn": "1479824643", | |
1116 | + "state": "0" | |
1117 | + }, | |
1118 | + { | |
1119 | + "keySn": "1479824645", | |
1120 | + "state": "0" | |
1121 | + }, | |
1122 | + { | |
1123 | + "keySn": "1479824644", | |
1124 | + "state": "1" | |
1125 | + } | |
1126 | + ] | |
1127 | +} | |
1128 | +``` | |
1129 | + | |
1130 | +### Online status | |
1131 | +#### Method | |
1132 | +##### startGetKpOnline | |
1133 | +- **Subject**:/client/\${baseSN}/send | |
1134 | +- **Function description**: Start to get keypad online information, keypad online returns keypad information [sEvtBsKpOnlineMsg](#sevtbskponlinemsg) | |
1135 | +- **Parameter Description** | |
1136 | + | |
1137 | +|Parameter name|Type|Restriction|Required|Description| | |
1138 | +|---|---|---|---|---| | |
1139 | +|fun|string|-|True|Command name| | |
1140 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1141 | + | |
1142 | +- **Sample Code** | |
1143 | + | |
1144 | +```json | |
1145 | +{ | |
1146 | + "fun": "startGetKpOnline", | |
1147 | + "dataTag":"1" | |
1148 | +} | |
1149 | +``` | |
1150 | + | |
1151 | +##### stopGetKpOnline | |
1152 | +- **Subject**:/client/\${baseSN}/send | |
1153 | +- **Function description**: Stop obtaining keypad online information | |
1154 | +- **Parameter Description** | |
1155 | + | |
1156 | +|Parameter name|Type|Restriction|Required|Description| | |
1157 | +|---|---|---|---|---| | |
1158 | +|fun|string|-|True|Command name| | |
1159 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1160 | + | |
1161 | +- **Sample Code** | |
1162 | + | |
1163 | +```json | |
1164 | +{ | |
1165 | + "fun": "stopGetKpOnline", | |
1166 | + "dataTag":"1" | |
1167 | +} | |
1168 | +``` | |
1169 | + | |
1170 | +#### Event | |
1171 | +##### [sEvtStateCode](#sevtstatecode) | |
1172 | +This event is returned after sending the command | |
1173 | + | |
1174 | +##### [sEvtBsKpOnlineMsg](#sevtbskponlinemsg) | |
1175 | +The keypad is online and returns this event | |
1176 | + | |
1177 | +### Maintenance Function | |
1178 | +#### Method | |
1179 | +##### remoteKpSleep | |
1180 | +- **Subject**:/client/\${baseSN}/send | |
1181 | +- **Function description**: Remote control keypad sleep | |
1182 | +- **Parameter Description** | |
1183 | + | |
1184 | +|Parameter name|Type|Restriction|Required|Description| | |
1185 | +|---|---|---|---|---| | |
1186 | +|fun|string|-|True|Command name| | |
1187 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1188 | +|data|object|-|True|The object array to pass parameters| | |
1189 | +|+keySns|array||False|The keypad SN array that needs to execute the command, an empty array means all keypad| | |
1190 | + | |
1191 | +- **Sample Code** | |
1192 | + | |
1193 | +```json | |
1194 | +{ | |
1195 | + "fun":"remoteKpSleep", | |
1196 | + "dataTag":"1", | |
1197 | + "data":{ | |
1198 | + "keySns":["1479824644"] | |
1199 | + } | |
1200 | +} | |
1201 | +``` | |
1202 | + | |
1203 | +#### Event | |
1204 | +##### [sEvtStateCode](#sevtstatecode) | |
1205 | +Returns the command reception status | |
1206 | + | |
1207 | +## Binding | |
1208 | +### Wireless Binding | |
1209 | +#### Method | |
1210 | +##### rtSetKpBindingInfo | |
1211 | +- **Subject**:/client/\${baseSN}/send | |
1212 | +- **Function description**: Set binding information to keypad in real time | |
1213 | +- **Parameter Description** | |
1214 | + | |
1215 | + | |
1216 | +|Parameter name|Type|Restriction|Required|Description| | |
1217 | +|---|---|---|---|---| | |
1218 | +|fun|string|-|True|Command name| | |
1219 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1220 | +|data|array|-|True|The object array to pass parameters,cannot be empty| | |
1221 | +|++keySn|string||True|Keypad SN that need to set binding info.| | |
1222 | +|++info|string||True|the binding information, usually the student's name<br>up to 48 characters, displayed in the upper left corner of the keypad| | |
1223 | + | |
1224 | +- **Sample Code** | |
1225 | + | |
1226 | +```json | |
1227 | +{ | |
1228 | + "fun": "rtSetKpBindingInfo", | |
1229 | + "dataTag":"1", | |
1230 | + "data": [ | |
1231 | + { | |
1232 | + "keySn": "1479824643", | |
1233 | + "info": "张三" | |
1234 | + }, | |
1235 | + { | |
1236 | + "keySn": "1479824644", | |
1237 | + "info": "李四" | |
1238 | + } | |
1239 | + ] | |
1240 | +} | |
1241 | +``` | |
1242 | + | |
1243 | +##### clearKpBindingInfo | |
1244 | +- **Subject**:/client/\${baseSN}/send | |
1245 | +- **Function description**: Clear keypad binding information | |
1246 | +- **Parameter Description** | |
1247 | + | |
1248 | + | |
1249 | +|Parameter name|Type|Restriction|Required|Description| | |
1250 | +|---|---|---|---|---| | |
1251 | +|fun|string|-|True|Command name| | |
1252 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1253 | +|data|object|-|True|The object array to pass parameters| | |
1254 | +|+keySns|array||False|The keypad SN array that needs to clear, an empty array means clear all keypad| | |
1255 | + | |
1256 | +- **Sample Code** | |
1257 | + | |
1258 | +```json | |
1259 | +{ | |
1260 | + "fun": "clearKpBindingInfo", | |
1261 | + "dataTag":"1", | |
1262 | + "data": { | |
1263 | + "keySns":["1479824643","1479824644","1479824645"] | |
1264 | + } | |
1265 | +} | |
1266 | +``` | |
1267 | + | |
1268 | +#### Event | |
1269 | +##### [sEvtStateCode](#sevtstatecode) | |
1270 | +Return to receiving status after sending command | |
1271 | + | |
1272 | +##### fEvtKpBindingInfo | |
1273 | +- **Subject**:/basestation/\${baseSN}/receive | |
1274 | +- **Function description**: Returns whether the keypad real-time setting binding information status is successful | |
1275 | +- **Parameter Description** | |
1276 | + | |
1277 | +|Parameter name|Type|Restriction|Not null|Description| | |
1278 | +|---|---|---|---|---| | |
1279 | +|fun|string|-|True|Command name| | |
1280 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1281 | +|data|array|-|False|The object array to pass parameters| | |
1282 | +|++keySn|string||True|Keypad SN that need to set binding info.| | |
1283 | +|++state|string||True|Whether the binding information is set successfully<br>0 - Success<br>1 - Failure| | |
1284 | + | |
1285 | +- **Sample Code** | |
1286 | + | |
1287 | +```json | |
1288 | +{ | |
1289 | + "fun": "fEvtKpBindingInfo", | |
1290 | + "dataTag":"1", | |
1291 | + "data": [ | |
1292 | + { | |
1293 | + "keySn": "1479824643", | |
1294 | + "state": "0" | |
1295 | + }, | |
1296 | + { | |
1297 | + "keySn": "1479824644", | |
1298 | + "state": "1" | |
1299 | + } | |
1300 | + ] | |
1301 | +} | |
1302 | +``` | |
1303 | + | |
1304 | +##### fEvtClearKpBindingInfo | |
1305 | +- **Subject**:/basestation/\${baseSN}/receive | |
1306 | +- **Function description**: Returns whether the command status of clearing binding information is successful | |
1307 | +- **Parameter Description** | |
1308 | + | |
1309 | +|Parameter name|Type|Restriction|Not null|Description| | |
1310 | +|---|---|---|---|---| | |
1311 | +|fun|string|-|True|Command name| | |
1312 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1313 | +|data|object|-|False|The object to pass parameters| | |
1314 | +|+state|string||False|Whether the binding information is set successfully<br>0 - Success<br>1 - Failure| | |
1315 | + | |
1316 | +- **Sample Code** | |
1317 | + | |
1318 | +```json | |
1319 | +{ | |
1320 | + "fun": "fEvtClearKpBindingInfo", | |
1321 | + "dataTag":"1", | |
1322 | + "data": { | |
1323 | + "state": "0" | |
1324 | + } | |
1325 | +} | |
1326 | +``` | |
1327 | + | |
1328 | +## Sign in | |
1329 | +### Sign in at any time | |
1330 | +#### Method | |
1331 | +##### rtStartKpSignIn | |
1332 | +- **Subject**:/client/\${baseSN}/send | |
1333 | +- **Function description**: Enable binding for sign in at any time | |
1334 | +- **Parameter Description** | |
1335 | + | |
1336 | +|Parameter name|Type|Restriction|Required|Description| | |
1337 | +|---|---|---|---|---| | |
1338 | +|fun|string|-|True|Command name| | |
1339 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1340 | +|data|object|-|False|The object to pass parameters| | |
1341 | +|+mode|int|-|False|Sign-in mode<br>2-PIN code sign-in, after entering the PIN code, the application decides whether to authorize|| | |
1342 | + | |
1343 | +- **Sample Code** | |
1344 | + | |
1345 | +```json | |
1346 | +{ | |
1347 | + "fun": "rtStartKpSignIn", | |
1348 | + "dataTag":"1", | |
1349 | + "data":{ | |
1350 | + "mode":2 | |
1351 | + } | |
1352 | +} | |
1353 | +``` | |
1354 | + | |
1355 | +##### rtStopKpSignIn | |
1356 | +- **Subject**:/client/\${baseSN}/send | |
1357 | +- **Function description**: Stop binding for signing in | |
1358 | +- **Parameter Description** | |
1359 | + | |
1360 | + | |
1361 | +|Parameter name|Type|Restriction|Required|Description| | |
1362 | +|---|---|---|---|---| | |
1363 | +|fun|string|-|True|Command name| | |
1364 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1365 | + | |
1366 | +- **Sample Code** | |
1367 | + | |
1368 | +```json | |
1369 | +{ | |
1370 | + "fun": "rtStopKpSignIn", | |
1371 | + "dataTag":"1" | |
1372 | +} | |
1373 | +``` | |
1374 | + | |
1375 | +##### rtSetKpLoginAllowed | |
1376 | +- **Subject**:/client/\${baseSN}/send | |
1377 | +- **Function description**: Real-time PIN binding authorization, authorization can be cancelled | |
1378 | +- **Parameter Description** | |
1379 | + | |
1380 | +|Parameter name|Type|Restriction|Required|Description| | |
1381 | +|---|---|---|---|---| | |
1382 | +|fun|string|-|True|Command name| | |
1383 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1384 | +|data|object|-|False|The object to pass parameters| | |
1385 | +|+keySn|string|-|True|Keypad SN| | |
1386 | +|+state|int|-|True|1-Authorization successful<br>2-Authorization failed<br>3-Release authorization| | |
1387 | + | |
1388 | +- **Sample Code** | |
1389 | + | |
1390 | +```json | |
1391 | +{ | |
1392 | + "fun": "rtSetKpLoginAllowed", | |
1393 | + "dataTag":"1", | |
1394 | + "data":{ | |
1395 | + "keySn":"1479824643", | |
1396 | + "state":1 | |
1397 | + } | |
1398 | +} | |
1399 | +``` | |
1400 | + | |
1401 | +#### Event | |
1402 | +##### [sEvtStateCode](#sevtstatecode) | |
1403 | +Return to receiving status after sending command | |
1404 | + | |
1405 | +##### fEvtKpSignIn | |
1406 | +- **Subject**:/basestation/\${baseSN}/receive | |
1407 | +- **Function description**: Return to the keypad to submit sign-in information | |
1408 | +- **Parameter Description** | |
1409 | + | |
1410 | +|Parameter name|Type|Restriction|Not null|Description| | |
1411 | +|---|---|---|---|---| | |
1412 | +|fun|string|-|True|Command name| | |
1413 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1414 | +|data|array|-|True|The object array to pass parameters| | |
1415 | +|++keySn|string||True|Keypad SN| | |
1416 | +|++keyValue|string||True|Pressing value submitted by the keypad| | |
1417 | +|++keyTime|double||True|the time to answer the question, calculated from the start, in seconds| | |
1418 | + | |
1419 | +- **Sample Code** | |
1420 | + | |
1421 | +```json | |
1422 | +{ | |
1423 | + "fun": "fEvtKpSignIn", | |
1424 | + "dataTag":"1", | |
1425 | + "data": [{ | |
1426 | + "keySn": "1234567890", | |
1427 | + "keyValue":"1004", | |
1428 | + "keyTime":30.2 | |
1429 | + }, | |
1430 | + { | |
1431 | + "keySn": "1234567891", | |
1432 | + "keyValue":"1003", | |
1433 | + "keyTime":32.5 | |
1434 | + } | |
1435 | + ] | |
1436 | +} | |
1437 | +``` | |
1438 | + | |
1439 | +##### fEvtKpLoginAllowed | |
1440 | +- **Subject**:/basestation/\${baseSN}/receive | |
1441 | +- **Function description**: Return keypad authorization status | |
1442 | +- **Parameter Description** | |
1443 | + | |
1444 | +|Parameter name|Type|Restriction|Not null|Description| | |
1445 | +|---|---|---|---|---| | |
1446 | +|fun|string|-|True|Command name| | |
1447 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1448 | +|data|object|-|True|The object to pass parameters| | |
1449 | +|+keySn|string||True|Keypad SN| | |
1450 | +|+state|string||True|0-execution successful<br> 1-execution failed| | |
1451 | + | |
1452 | +- **Sample Code** | |
1453 | + | |
1454 | +```json | |
1455 | +{ | |
1456 | + "fun": "fEvtKpLoginAllowed", | |
1457 | + "dataTag":"1", | |
1458 | + "data": { | |
1459 | + "keySn":"1479824643", | |
1460 | + "state":"0" | |
1461 | + } | |
1462 | +} | |
1463 | +``` | |
1464 | + | |
1465 | +## Key pressing feedback | |
1466 | +### True or False | |
1467 | +#### Method | |
1468 | +##### startQATrueFalse | |
1469 | +- **Subject**:/client/\${baseSN}/send | |
1470 | +- **Function description**: Start true or false questions | |
1471 | +- **Parameter Description** | |
1472 | + | |
1473 | +|Parameter name|Type|Restriction|Required|Description| | |
1474 | +|---|---|---|---|---| | |
1475 | +|fun|string|-|True|Command name| | |
1476 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1477 | +|data|object|-|True|The object to pass parameters| | |
1478 | +|+keySns|array||True|The specified Keypad SN array, an empty array means all online keypads| | |
1479 | +|+mode|int||True|1 - True/False <br>2 - Yes/No <br> 3 - √/×| | |
1480 | +|+allowModify|int||True|0 - do not allow modification<br>1 - allow modification| | |
1481 | +|+tip|string||False|Title of the tip, no longer than 16 characters| | |
1482 | + | |
1483 | +- **Sample Code** | |
1484 | + | |
1485 | +```json | |
1486 | +{ | |
1487 | + "fun": "startQATrueFalse", | |
1488 | + "dataTag":"1", | |
1489 | + "data":{ | |
1490 | + "keySns":[], | |
1491 | + "mode":1, | |
1492 | + "allowModify":1, | |
1493 | + "tip":"" | |
1494 | + } | |
1495 | +} | |
1496 | +``` | |
1497 | + | |
1498 | +##### stopQATrueFalse | |
1499 | +- **Subject**:/client/\${baseSN}/send | |
1500 | +- **Function description**: Stop true or false questions | |
1501 | +- **Parameter Description** | |
1502 | + | |
1503 | +|Parameter name|Type|Restriction|Required|Description| | |
1504 | +|---|---|---|---|---| | |
1505 | +|fun|string|-|True|Command name| | |
1506 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1507 | + | |
1508 | +- **Sample Code** | |
1509 | + | |
1510 | +```json | |
1511 | +{ | |
1512 | + "fun": "stopQATrueFalse", | |
1513 | + "dataTag":"1" | |
1514 | +} | |
1515 | +``` | |
1516 | + | |
1517 | +#### Event | |
1518 | +##### [sEvtStateCode](#sevtstatecode) | |
1519 | +Return to receiving status after sending command | |
1520 | + | |
1521 | +##### fEvtQATrueFalse | |
1522 | +- **Subject**:/basestation/\${baseSN}/receive | |
1523 | +- **Function description**: Return to the keypad to submit answer information | |
1524 | +- **Parameter Description** | |
1525 | + | |
1526 | +|Parameter name|Type|Restriction|Not null|Description| | |
1527 | +|---|---|---|---|---| | |
1528 | +|fun|string|-|True|Command name| | |
1529 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1530 | +|data|array|-|True|The object array to pass parameters| | |
1531 | +|++keySn|string||True|Keypad SN| | |
1532 | +|++keyValue|string||True|the value submitted by the keypad<br>1-true<br>2-false| | |
1533 | +|++keyTime|double||True|the time to answer the question, calculated from the start, in seconds| | |
1534 | + | |
1535 | +- **Sample Code** | |
1536 | + | |
1537 | +```json | |
1538 | +{ | |
1539 | + "fun": "fEvtQATrueFalse", | |
1540 | + "dataTag":"1", | |
1541 | + "data": [{ | |
1542 | + "keySn": "1234567890", | |
1543 | + "keyValue":"1", | |
1544 | + "keyTime":30.2 | |
1545 | + } | |
1546 | + ] | |
1547 | +} | |
1548 | +``` | |
1549 | + | |
1550 | +### Multiple choice questions | |
1551 | +#### Method | |
1552 | +##### startQAChoice | |
1553 | +- **Subject**:/client/\${baseSN}/send | |
1554 | +- **Function description**: Start multiple-choice questions | |
1555 | +- **Parameter Description** | |
1556 | + | |
1557 | +|Parameter name|Type|Restriction|Required|Description| | |
1558 | +|---|---|---|---|---| | |
1559 | +|fun|string|-|True|Command name| | |
1560 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1561 | +|data|object|-|True|The object to pass parameters| | |
1562 | +|+keySns|array||True|The specified Keypad SN array, an empty array means all online keypads| | |
1563 | +|+mode|int||True|Display mode<br>1:display letters (default value) </br>2:display numbers| | |
1564 | +|+lessMode|int||True|Forced selection mode<br>0: optional (default value) </br>1: cannot missing </br>2: Repeated input is allowed</br>3: Repeated input is allowed and cannot be missing | | |
1565 | +|+options|int||True|the number of options,1≤M≤10(Default 4)| | |
1566 | +|+optionalN|int||True|the selectable number of options,1≤N≤M(Defaule 1)| | |
1567 | +|+allowModify|int||True|Modify mode<br>0 - Do not allow modification<br>1 - Allow modification| | |
1568 | +|+tip|string||False|Title of the tip, no longer than 16 characters| | |
1569 | + | |
1570 | +- **Sample Code** | |
1571 | + | |
1572 | +```json | |
1573 | +{ | |
1574 | + "fun": "startQAChoice", | |
1575 | + "dataTag":"1", | |
1576 | + "data":{ | |
1577 | + "keySns":[], | |
1578 | + "mode": 1, | |
1579 | + "lessMode": 0, | |
1580 | + "options": 4, | |
1581 | + "optionalN": 1, | |
1582 | + "allowModify":1, | |
1583 | + "tip":"" | |
1584 | + } | |
1585 | +} | |
1586 | +``` | |
1587 | + | |
1588 | +##### stopQAChoice | |
1589 | +- **Subject**:/client/\${baseSN}/send | |
1590 | +- **Function description**: Stop multiple-choice questions | |
1591 | +- **Parameter Description** | |
1592 | + | |
1593 | +|Parameter name|Type|Restriction|Required|Description| | |
1594 | +|---|---|---|---|---| | |
1595 | +|fun|string|-|True|Command name| | |
1596 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1597 | + | |
1598 | +- **Sample Code** | |
1599 | + | |
1600 | +```json | |
1601 | +{ | |
1602 | + "fun": "stopQAChoice", | |
1603 | + "dataTag":"1" | |
1604 | +} | |
1605 | +``` | |
1606 | + | |
1607 | +#### Event | |
1608 | +##### [sEvtStateCode](#sevtstatecode) | |
1609 | +Return to receiving status after sending command | |
1610 | + | |
1611 | +##### fEvtQAChoice | |
1612 | +- **Subject**:/basestation/\${baseSN}/receive | |
1613 | + **Function description**: Return to the keypad to submit answer information | |
1614 | +- **Parameter Description** | |
1615 | + | |
1616 | +|Parameter name|Type|Restriction|Not null|Description| | |
1617 | +|---|---|---|---|---| | |
1618 | +|fun|string|-|True|Command name| | |
1619 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1620 | +|data|array|-|True|The object array to pass parameters| | |
1621 | +|++keySn|string||True|Keypad SN| | |
1622 | +|++keyValue|string||True|The value submitted by the keypad| | |
1623 | +|++keyTime|double||True|The time to answer the question, calculated from the start, in seconds| | |
1624 | + | |
1625 | +- **Sample Code** | |
1626 | + | |
1627 | +```json | |
1628 | +{ | |
1629 | + "fun": "fEvtQAChoice", | |
1630 | + "dataTag":"1", | |
1631 | + "data": [{ | |
1632 | + "keySn": "1234567890", | |
1633 | + "keyValue":"A", | |
1634 | + "keyTime":3.2 | |
1635 | + }] | |
1636 | +} | |
1637 | +``` | |
1638 | + | |
1639 | +### Numeric | |
1640 | +#### Method | |
1641 | +##### startQANum | |
1642 | +- **Subject**:/client/\${baseSN}/send | |
1643 | +- **Function description**: Start Numeric Question | |
1644 | +- **Parameter Description** | |
1645 | + | |
1646 | +|Parameter name|Type|Restriction|Required|Description| | |
1647 | +|---|---|---|---|---| | |
1648 | +|fun|string|-|True|Command name| | |
1649 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1650 | +|data|object|-|True|The object to pass parameters| | |
1651 | +|+keySns|array||True|The specified Keypad SN array, an empty array means all online keypads| | |
1652 | +|+mode|int||True|mode<br>0: No rules (S6 up to 16 digits, T2 up to 14 digits)<br>1: With upper and lower decimal places (T2 does not support)| | |
1653 | +|+digits|int||True|the number of decimal places, ranging from 0 to 2, valid when mode=1 | |
1654 | +|+numMin|int||True|Lower limit can be input, mode=1 is effective, range 0-100| | |
1655 | +|+numMax|int||True|Upper limit can be input, mode=1 is effective, range 0-100| | |
1656 | +|+allowModify|int||True|Modify mode<br>0 - Do not allow modification<br>1 - Allow modification| | |
1657 | +|+tip|string||False|Title of the tip, no longer than 16 characters| | |
1658 | + | |
1659 | +- **Sample Code** | |
1660 | + | |
1661 | +```json | |
1662 | +{ | |
1663 | + "fun": "startQANum", | |
1664 | + "dataTag":"1", | |
1665 | + "data":{ | |
1666 | + "keySns":[], | |
1667 | + "mode": 1, | |
1668 | + "digits": 1, | |
1669 | + "numMin": 0, | |
1670 | + "numMax": 100, | |
1671 | + "allowModify":1, | |
1672 | + "tip":"" | |
1673 | + } | |
1674 | +} | |
1675 | +``` | |
1676 | + | |
1677 | +##### stopQANum | |
1678 | +- **Subject**:/client/\${baseSN}/send | |
1679 | +- **Function description**: Stop Numeric Question | |
1680 | +- **Parameter Description** | |
1681 | + | |
1682 | +|Parameter name|Type|Restriction|Required|Description| | |
1683 | +|---|---|---|---|---| | |
1684 | +|fun|string|-|True|Command name| | |
1685 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1686 | + | |
1687 | +- **Sample Code** | |
1688 | + | |
1689 | +```json | |
1690 | +{ | |
1691 | + "fun": "stopQANum", | |
1692 | + "dataTag":"1" | |
1693 | +} | |
1694 | +``` | |
1695 | + | |
1696 | +#### Event | |
1697 | +##### [sEvtStateCode](#sevtstatecode) | |
1698 | +Return to receiving status after sending command | |
1699 | + | |
1700 | +##### fEvtQANum | |
1701 | +- **Subject**:/basestation/\${baseSN}/receive | |
1702 | +- **Function description**: Return to the keypad to submit answer information | |
1703 | +- **Parameter Description** | |
1704 | + | |
1705 | +|Parameter name|Type|Restriction|Not null|Description| | |
1706 | +|---|---|---|---|---| | |
1707 | +|fun|string|-|True|Command name| | |
1708 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1709 | +|data|array|-|True|The object array to pass parameters| | |
1710 | +|++keySn|string||True|Keypad SN| | |
1711 | +|++keyValue|string||True|The value submitted by the keypad| | |
1712 | +|++keyTime|double||True|The time to answer the question, calculated from the start, in seconds| | |
1713 | + | |
1714 | +- **Sample Code** | |
1715 | + | |
1716 | +```json | |
1717 | +{ | |
1718 | + "fun": "fEvtQANum", | |
1719 | + "dataTag":"1", | |
1720 | + "data": { | |
1721 | + "keySn": "1234567890", | |
1722 | + "keyValue":"10", | |
1723 | + "keyTime":3.2 | |
1724 | + } | |
1725 | +} | |
1726 | +``` | |
1727 | + | |
1728 | +### Rush Answer | |
1729 | +#### Method | |
1730 | +##### startQAQuicker | |
1731 | +- **Subject**:/client/\${baseSN}/send | |
1732 | +- **Function description**: Start Rush Answer | |
1733 | +- **Parameter Description** | |
1734 | + | |
1735 | +|Parameter name|Type|Restriction|Not null|Description| | |
1736 | +|---|---|---|---|---| | |
1737 | +|fun|string|-|True|Command name| | |
1738 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1739 | +|data|object|-|True|The object to pass parameters| | |
1740 | +|+keySns|array||True|The specified Keypad SN array, an empty array means all online keypads| | |
1741 | +|+mode|int||True|mode<br>0: normal answer| | |
1742 | +|+allowModify|int||True|Modify mode<br>0 - Do not allow modification<br>1 - Allow modification| | |
1743 | +|+tip|string||False|Title of the tip, no longer than 16 characters| | |
1744 | + | |
1745 | +- **Sample Code** | |
1746 | + | |
1747 | +```json | |
1748 | +{ | |
1749 | + "fun": "startQAQuicker", | |
1750 | + "dataTag":"1", | |
1751 | + "data":{ | |
1752 | + "keySns":[], | |
1753 | + "mode": 0, | |
1754 | + "allowModify":1, | |
1755 | + "tip":"" | |
1756 | + } | |
1757 | +} | |
1758 | +``` | |
1759 | + | |
1760 | +##### stopQAQuicker | |
1761 | +- **Subject**:/client/\${baseSN}/send | |
1762 | +- **Function description**: Start Rush Answer | |
1763 | +- **Parameter Description** | |
1764 | + | |
1765 | +|Parameter name|Type|Restriction|Required|Description| | |
1766 | +|---|---|---|---|---| | |
1767 | +|fun|string|-|True|Command name| | |
1768 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1769 | + | |
1770 | +- **Sample Code** | |
1771 | + | |
1772 | +```json | |
1773 | +{ | |
1774 | + "fun": "stopQAQuicker", | |
1775 | + "dataTag":"1" | |
1776 | +} | |
1777 | +``` | |
1778 | + | |
1779 | +#### Event | |
1780 | +##### [sEvtStateCode](#sevtstatecode) | |
1781 | +Return to receiving status after sending command | |
1782 | + | |
1783 | +##### fEvtQAQuicker | |
1784 | +- **Subject**:/basestation/\${baseSN}/receive | |
1785 | +- **Function description**: Return to the keypad to submit answer information | |
1786 | +- **Parameter Description** | |
1787 | + | |
1788 | +|Parameter name|Type|Restriction|Not null|Description| | |
1789 | +|---|---|---|---|---| | |
1790 | +|fun|string|-|True|Command name| | |
1791 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1792 | +|data|array|-|True|The object array to pass parameters| | |
1793 | +|++keySn|string||True|Keypad SN| | |
1794 | +|++keyValue|string||True|The value submitted by the keypad| | |
1795 | +|++keyTime|double||True|The time to answer the question, calculated from the start, in seconds| | |
1796 | + | |
1797 | +- **Sample Code** | |
1798 | + | |
1799 | +```json | |
1800 | +{ | |
1801 | + "fun": "fEvtQAQuicker", | |
1802 | + "dataTag":"1", | |
1803 | + "data": [{ | |
1804 | + "keySn": "1234567890", | |
1805 | + "keyValue":"1", | |
1806 | + "keyTime":3.2 | |
1807 | + }] | |
1808 | +} | |
1809 | +``` | |
1810 | + | |
1811 | +## Online Quiz | |
1812 | +### Standard Test | |
1813 | +#### Method | |
1814 | +##### startKpExam | |
1815 | +- **Subject**:/client/\${baseSN}/send | |
1816 | +- **Function description**: Start standard test | |
1817 | +- **Parameter Description** | |
1818 | + | |
1819 | +|Parameter name|Type|Restriction|Required|Description| | |
1820 | +|---|---|---|---|---| | |
1821 | +|fun|string|-|True|Command name| | |
1822 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1823 | +|data|object|-|True|The object to pass parameters| | |
1824 | +|+examNo|int||True|0-9999<br>=0,new test<br>>0, continue the test if the roll number is the same as the last one , otherwise start a new test| | |
1825 | +|+mode|int||True|Display mode<br>0-Do not display the beginning<br>1-Display the beginning of "Q"<br>2-Display the beginning of "题"| | |
1826 | +|+questions|array||True|question details| | |
1827 | +|++symbol | string||True | Question prefix, can be empty| | |
1828 | +|++quesType | int||True| Question type<br>1: Single choice<br>2: Multiple choices (sort)<br>3: Numeric<br>4: Judgement| | |
1829 | +|++option |int||True |Number of options<br> quesType = 1 is valid. <br> quesType = 2 is valid. <br> The default value of this option is 4; <br> Range: 1-10. | | |
1830 | +|++startNo | int||True| Starting question number | | |
1831 | +|++count | int||True| The number of questions | | |
1832 | + | |
1833 | +- **Sample Code** | |
1834 | + | |
1835 | +```json | |
1836 | +//Custom question number | |
1837 | +{ | |
1838 | + "fun": "startKpExam", | |
1839 | + "dataTag":"1", | |
1840 | + "data":{ | |
1841 | + "mode": 0, | |
1842 | + "examNo": 1, | |
1843 | + "questions": [{ | |
1844 | + //Question number 1-1-1 to 1-1-10, 10 questions in total, single choice | |
1845 | + "symbol": "1-1-", | |
1846 | + "quesType": 1, | |
1847 | + "startNo": 1, | |
1848 | + "count":10 | |
1849 | + }, { | |
1850 | + //Question No. 2-2 and 2-3 are two multiple-choice questions with 5 options | |
1851 | + "symbol": "2-", | |
1852 | + "quesType": 2, | |
1853 | + "option": 5, | |
1854 | + "startNo": 2, | |
1855 | + "count":2 | |
1856 | + }, { | |
1857 | + //Question No. 3-1 and 3-2 are two numerical questions | |
1858 | + "symbol": "3-", | |
1859 | + "quesType": 3, | |
1860 | + "startNo": 1, | |
1861 | + "count":2 | |
1862 | + }, { | |
1863 | + //Question No. 4 and 5, true or false questions | |
1864 | + "symbol": "", | |
1865 | + "quesType": 4, | |
1866 | + "startNo": 4, | |
1867 | + "count":2 | |
1868 | + }] | |
1869 | + } | |
1870 | +} | |
1871 | + | |
1872 | +//Display the beginning of Q | |
1873 | +{ | |
1874 | + "fun": "startKpExam", | |
1875 | + "dataTag":"1", | |
1876 | + "data":{ | |
1877 | + "mode": 1, | |
1878 | + "examNo": 1, | |
1879 | + "questions": [{ | |
1880 | + //Q1-Q20,single choice questions | |
1881 | + "symbol": "", | |
1882 | + "quesType": 1, | |
1883 | + "startNo": 1, | |
1884 | + "count":20 | |
1885 | + }] | |
1886 | + } | |
1887 | +} | |
1888 | + | |
1889 | +//Show the beginning of the question | |
1890 | +{ | |
1891 | + "fun": "startKpExam", | |
1892 | + "dataTag":"1", | |
1893 | + "data":{ | |
1894 | + "mode": 2, | |
1895 | + "examNo": 1, | |
1896 | + "questions": [{ | |
1897 | + //Question 1-Question 20, single choice questions | |
1898 | + "symbol": "", | |
1899 | + "quesType": 1, | |
1900 | + "startNo": 1, | |
1901 | + "count":20 | |
1902 | + }] | |
1903 | + } | |
1904 | +} | |
1905 | +``` | |
1906 | + | |
1907 | +##### stopKpExam | |
1908 | +- **Subject**:/client/\${baseSN}/send | |
1909 | +- **Function description**: Stop standard test | |
1910 | +- **Parameter Description** | |
1911 | + | |
1912 | +|Parameter name|Type|Restriction|Required|Description| | |
1913 | +|---|---|---|---|---| | |
1914 | +|fun|string|-|True|Command name| | |
1915 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1916 | + | |
1917 | +- **Sample Code** | |
1918 | + | |
1919 | +```json | |
1920 | +{ | |
1921 | + "fun": "stopKpExam", | |
1922 | + "dataTag":"1" | |
1923 | +} | |
1924 | +``` | |
1925 | + | |
1926 | +##### rtKpAllowEdited | |
1927 | +- **Subject**:/client/\${baseSN}/send | |
1928 | +- **Function description**: After keypad submission, allow the keypad to modify the answer | |
1929 | +- **Parameter Description** | |
1930 | + | |
1931 | +|Parameter name|Type|Restriction|Required|Description| | |
1932 | +|---|---|---|---|---| | |
1933 | +|fun|string|-|True|Command name| | |
1934 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1935 | +|data|object|-|True|The object to pass parameters| | |
1936 | +|+keySns|array||True|The specified Keypad SN array, an empty array means all online keypads| | |
1937 | + | |
1938 | +- **Sample Code** | |
1939 | + | |
1940 | +```json | |
1941 | +{ | |
1942 | + "fun": "rtKpAllowEdited", | |
1943 | + "dataTag":"1", | |
1944 | + "data":{ | |
1945 | + "keySns":["1234567890","1234567891"] | |
1946 | + } | |
1947 | +} | |
1948 | +``` | |
1949 | + | |
1950 | +#### Event | |
1951 | +##### [sEvtStateCode](#sevtstatecode) | |
1952 | +Return to receiving status after sending command | |
1953 | + | |
1954 | +##### fEvtKpExam | |
1955 | +- **Subject**:/basestation/\${baseSN}/receive | |
1956 | +- **Function description**: Return to the keypad to submit answer information | |
1957 | +- **Parameter Description** | |
1958 | + | |
1959 | +|Parameter name|Type|Restriction|Not null|Description| | |
1960 | +|---|---|---|---|---| | |
1961 | +|fun|string|-|True|Command name| | |
1962 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1963 | +|data|object|-|True|The object array to pass parameters| | |
1964 | +|++keySn|string||True|Keypad SN| | |
1965 | +|++keyValue|string||True|The value submitted by the keypad, 1:A;2:B means submit A for question 1 and B for question 2.| | |
1966 | +|++keyTime|double||True|The time to answer the question, calculated from the start, in seconds| | |
1967 | + | |
1968 | +- **Sample Code** | |
1969 | + | |
1970 | +```json | |
1971 | +{ | |
1972 | + "fun": "fEvtKpExam", | |
1973 | + "dataTag":"1", | |
1974 | + "data": [{ | |
1975 | + "keySn": "1234567890", | |
1976 | + "keyValue":"1:A;2:B", | |
1977 | + "keyTime":3.2 | |
1978 | + }, | |
1979 | + { | |
1980 | + "keySn": "1234567891", | |
1981 | + "keyValue":"1:B;2:B", | |
1982 | + "keyTime":3.5 | |
1983 | + } | |
1984 | + ] | |
1985 | +} | |
1986 | +``` | |
1987 | + | |
1988 | +##### fEvtFinalSubmit | |
1989 | +- **Subject**:/basestation/\${baseSN}/receive | |
1990 | +**Function description**: Return to the manual tests submission mark on the keypad | |
1991 | +- **Parameter Description** | |
1992 | + | |
1993 | +|Parameter name|Type|Restriction|Not null|Description| | |
1994 | +|---|---|---|---|---| | |
1995 | +|fun|string|-|True|Command name| | |
1996 | +|dataTag|string|-|False|Data packet tag, can be an empty string| | |
1997 | +|data|array|-|True|The object array to pass parameters| | |
1998 | +|++keySn|string||True|Keypad SN| | |
1999 | +|++keyValue|string||True|0 - Not submitted (reported when modifying keypad operation submission)<br>1 - Submitted| | |
2000 | +|++keyTime|double||True|The time to answer the question, calculated from the start, in seconds| | |
2001 | + | |
2002 | +- **Sample Code** | |
2003 | + | |
2004 | +```json | |
2005 | +{ | |
2006 | + "fun": "fEvtFinalSubmit", | |
2007 | + "dataTag":"1", | |
2008 | + "data": [{ | |
2009 | + "keySn": "1234567890", | |
2010 | + "keyValue":"1", | |
2011 | + "keyTime":3.2 | |
2012 | + }] | |
2013 | +} | |
2014 | +``` | ... | ... |