Commit 268b2882cce04bdd17b3e81dbdbf276864d8aee8

Authored by 孙向锦
1 parent f2e6b7ca

添加分包示例

Showing 1 changed file with 400 additions and 1 deletions
海亮定制.md
... ... @@ -176,6 +176,405 @@ ${clinetId} clinetId 是基站编号,为替换字符串。
176 176 | em | string | 错误消息em = "3" 配合et使用,如et=1 em=3 表示3号频点冲突 |
177 177 | success | number | 0 成功 -1 错误/失败 |
178 178  
  179 +### 3.2.4 分包示例
  180 +
  181 +如果要下发第二行文本,一次业务需要下发50个键盘。
  182 +正常组包:
  183 +```json
  184 +{
  185 + "i": 60,
  186 + "en": "6",
  187 + "cmd": 10,
  188 + "total": 1,
  189 + "current": 1,
  190 + "qs": 50,
  191 + "m": [{
  192 + "sn": "2126833671",
  193 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  194 + }, {
  195 + "sn": "2126833672",
  196 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  197 + }, {
  198 + "sn": "2126833673",
  199 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  200 + }, {
  201 + "sn": "2126833674",
  202 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  203 + }, {
  204 + "sn": "2126833675",
  205 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  206 + }, {
  207 + "sn": "2126833676",
  208 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  209 + }, {
  210 + "sn": "2126833677",
  211 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  212 + }, {
  213 + "sn": "2126833678",
  214 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  215 + }, {
  216 + "sn": "2126833679",
  217 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  218 + }, {
  219 + "sn": "2126833680",
  220 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  221 + }, {
  222 + "sn": "2126833681",
  223 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  224 + }, {
  225 + "sn": "2126833682",
  226 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  227 + }, {
  228 + "sn": "2126833683",
  229 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  230 + }, {
  231 + "sn": "2126833684",
  232 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  233 + }, {
  234 + "sn": "2126833685",
  235 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  236 + }, {
  237 + "sn": "2126833686",
  238 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  239 + }, {
  240 + "sn": "2126833687",
  241 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  242 + }, {
  243 + "sn": "2126833688",
  244 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  245 + }, {
  246 + "sn": "2126833689",
  247 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  248 + }, {
  249 + "sn": "2126833690",
  250 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  251 + }, {
  252 + "sn": "2126833691",
  253 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  254 + }, {
  255 + "sn": "2126833692",
  256 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  257 + }, {
  258 + "sn": "2126833693",
  259 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  260 + }, {
  261 + "sn": "2126833694",
  262 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  263 + }, {
  264 + "sn": "2126833695",
  265 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  266 + }, {
  267 + "sn": "2126833696",
  268 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  269 + }, {
  270 + "sn": "2126833697",
  271 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  272 + }, {
  273 + "sn": "2126833698",
  274 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  275 + }, {
  276 + "sn": "2126833699",
  277 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  278 + }, {
  279 + "sn": "2126833700",
  280 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  281 + }, {
  282 + "sn": "2126833701",
  283 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  284 + }, {
  285 + "sn": "2126833702",
  286 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  287 + }, {
  288 + "sn": "2126833703",
  289 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  290 + }, {
  291 + "sn": "2126833704",
  292 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  293 + }, {
  294 + "sn": "2126833705",
  295 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  296 + }, {
  297 + "sn": "2126833706",
  298 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  299 + }, {
  300 + "sn": "2126833707",
  301 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  302 + }, {
  303 + "sn": "2126833708",
  304 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  305 + }, {
  306 + "sn": "2126833709",
  307 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  308 + }, {
  309 + "sn": "2126833710",
  310 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  311 + }, {
  312 + "sn": "2126833711",
  313 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  314 + }, {
  315 + "sn": "2126833712",
  316 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  317 + }, {
  318 + "sn": "2126833713",
  319 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  320 + }, {
  321 + "sn": "2126833714",
  322 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  323 + }, {
  324 + "sn": "2126833715",
  325 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  326 + }, {
  327 + "sn": "2126833716",
  328 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  329 + }, {
  330 + "sn": "2126833717",
  331 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  332 + }, {
  333 + "sn": "2126833718",
  334 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  335 + }, {
  336 + "sn": "2126833719",
  337 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  338 + }, {
  339 + "sn": "2126833720",
  340 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  341 + }]
  342 +}
  343 +```json
  344 +该数据大小超过了1k(实际4091字节),基站会接收失败。
  345 +要采取分包进行分送,每包大小不要超过1k(1024字节)
  346 +
  347 +第一包:
  348 +```json
  349 +{
  350 + "i": 60,
  351 + "en": "6",
  352 + "cmd": 10,
  353 + "total": 5,
  354 + "current": 1,
  355 + "qs": 60,
  356 + "m": [{
  357 + "sn": "2126833671",
  358 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  359 + }, {
  360 + "sn": "2126833672",
  361 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  362 + }, {
  363 + "sn": "2126833673",
  364 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  365 + }, {
  366 + "sn": "2126833674",
  367 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  368 + }, {
  369 + "sn": "2126833675",
  370 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  371 + }, {
  372 + "sn": "2126833676",
  373 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  374 + }, {
  375 + "sn": "2126833677",
  376 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  377 + }, {
  378 + "sn": "2126833678",
  379 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  380 + }, {
  381 + "sn": "2126833679",
  382 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  383 + }, {
  384 + "sn": "2126833680",
  385 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  386 + }]
  387 +}
  388 +
  389 +```
  390 +数据包大小892字节,基站能接收。
  391 +
  392 +<br>
  393 +
  394 +第二包:
  395 +```json
  396 +{
  397 + "i": 60,
  398 + "en": "6",
  399 + "cmd": 10,
  400 + "total": 5,
  401 + "current": 2,
  402 + "qs": 60,
  403 + "m": [{
  404 + "sn": "2126833681",
  405 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  406 + }, {
  407 + "sn": "2126833682",
  408 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  409 + }, {
  410 + "sn": "2126833683",
  411 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  412 + }, {
  413 + "sn": "2126833684",
  414 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  415 + }, {
  416 + "sn": "2126833685",
  417 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  418 + }, {
  419 + "sn": "2126833686",
  420 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  421 + }, {
  422 + "sn": "2126833687",
  423 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  424 + }, {
  425 + "sn": "2126833688",
  426 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  427 + }, {
  428 + "sn": "2126833689",
  429 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  430 + }, {
  431 + "sn": "2126833690",
  432 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  433 + }]
  434 +}
  435 +```
  436 +数据包大小892字节,基站能接收。
  437 +
  438 +<br>
  439 +
  440 +第三包:
  441 +```json
  442 +{
  443 + "i": 60,
  444 + "en": "6",
  445 + "cmd": 10,
  446 + "total": 5,
  447 + "current": 3,
  448 + "qs": 60,
  449 + "m": [{
  450 + "sn": "2126833691",
  451 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  452 + }, {
  453 + "sn": "2126833692",
  454 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  455 + }, {
  456 + "sn": "2126833693",
  457 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  458 + }, {
  459 + "sn": "2126833694",
  460 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  461 + }, {
  462 + "sn": "2126833695",
  463 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  464 + }, {
  465 + "sn": "2126833696",
  466 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  467 + }, {
  468 + "sn": "2126833697",
  469 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  470 + }, {
  471 + "sn": "2126833698",
  472 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  473 + }, {
  474 + "sn": "2126833699",
  475 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  476 + }, {
  477 + "sn": "2126833700",
  478 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  479 + }]
  480 +}
  481 +```
  482 +数据包大小892字节,基站能接收。
  483 +
  484 +<br>
  485 +第四包:
  486 +```json
  487 +{
  488 + "i": 60,
  489 + "en": "6",
  490 + "cmd": 10,
  491 + "total": 5,
  492 + "current": 4,
  493 + "qs": 60,
  494 + "m": [{
  495 + "sn": "2126833701",
  496 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  497 + }, {
  498 + "sn": "2126833702",
  499 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  500 + }, {
  501 + "sn": "2126833703",
  502 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  503 + }, {
  504 + "sn": "2126833704",
  505 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  506 + }, {
  507 + "sn": "2126833705",
  508 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  509 + }, {
  510 + "sn": "2126833706",
  511 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  512 + }, {
  513 + "sn": "2126833707",
  514 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  515 + }, {
  516 + "sn": "2126833708",
  517 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  518 + }, {
  519 + "sn": "2126833709",
  520 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  521 + }, {
  522 + "sn": "2126833710",
  523 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  524 + }]
  525 +}
  526 +```
  527 +数据包大小892字节,基站能接收。
  528 +
  529 +<br>
  530 +
  531 +第五包:
  532 +```json
  533 +{
  534 + "i": 60,
  535 + "en": "6",
  536 + "cmd": 10,
  537 + "total": 5,
  538 + "current": 5,
  539 + "qs": 60,
  540 + "m": [{
  541 + "sn": "2126833711",
  542 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  543 + }, {
  544 + "sn": "2126833712",
  545 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  546 + }, {
  547 + "sn": "2126833713",
  548 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  549 + }, {
  550 + "sn": "2126833714",
  551 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  552 + }, {
  553 + "sn": "2126833715",
  554 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  555 + }, {
  556 + "sn": "2126833716",
  557 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  558 + }, {
  559 + "sn": "2126833717",
  560 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  561 + }, {
  562 + "sn": "2126833718",
  563 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  564 + }, {
  565 + "sn": "2126833719",
  566 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  567 + }, {
  568 + "sn": "2126833720",
  569 + "text": "hex:cae4c8ebd1a7bac5bdf8d0d0b0f3b6a8"
  570 + }]
  571 +}
  572 +```
  573 +
  574 +数据包大小892字节,基站能接收。<br>
  575 +
  576 +每包的数据计算,少于1k即可。
  577 +
179 578  
180 579 ## 3.3 功能说明
181 580  
... ... @@ -395,7 +794,7 @@ ${clinetId} clinetId 是基站编号,为替换字符串。
395 794 | --- | --- |
396 795 | i = 31 |白名单上传 |
397 796 | total |一共上传的数据包数,这里分包原则参考指令属性m介绍说明|
398   -| current |当前第几包 |
  797 +| current |当前第几包 ,这里分包原则参考指令属性m介绍说明|
399 798 | m |键盘序列号列表 |
400 799  
401 800  
... ...