docs: 更正012注册和006绑定协议

This commit is contained in:
stu2not
2026-09-20 11:57:20 +08:00
parent 75fd3d86c4
commit 27e8ccfc2b
2 changed files with 44 additions and 31 deletions
+28 -6
View File
@@ -6,11 +6,12 @@ The mini-program binding flow validates an active `device_auth` row before it
creates a pending bind session. Final binding is completed after the device
returns an NFC card UUID.
This is the user/NFC binding flow and is separate from the device-level
`msg_id=012` bootstrap/binding handshake documented in
`02-device-bootstrap.md`. The `msg_id=012` success receipt assigns the device
identity and returns `iccid`; this flow binds that device to a mini-program
user and optional child through the NFC card exchange.
This is the `msg_id=006` device-binding flow and is separate from the device
registration handshake documented in `02-device-bootstrap.md`. `msg_id=012`
only registers the device identity. `msg_id=006` starts and completes binding
the device to a mini-program user and optional child through the NFC card
exchange; its successful receipt carries the ICCID needed by the downstream
SIM/traffic service.
```mermaid
sequenceDiagram
@@ -42,7 +43,7 @@ sequenceDiagram
API-->>Mini: bind_token, expires_at
end
Device->>MQTT: NFC response / card UUID
Device->>MQTT: msg_id=006 binding success / card UUID / ICCID
MQTT->>Binding: finalize_nfc_bind(device_id, card_uuid)
Binding->>DAO: load latest pending bind session
Binding->>Card: activate_card(card_uuid, device_id)
@@ -51,6 +52,27 @@ sequenceDiagram
Binding->>DAO: mark session completed
```
## Binding Success Receipt
The successful device-binding receipt uses `msg_id=006` and includes the
authoritative ICCID:
```json
{
"msg_id": "006",
"params": {
"device_id": "TalkingQ_ZHWK00002110",
"device_sn": "TQ_ZHWK000000002110",
"iccid": "898604E91123D1334901"
}
}
```
The ICCID must come from the authoritative IMEI-to-ICCID provisioning record
or a validated device report. It must not be derived from the IMEI. If the
binding response cannot provide a valid ICCID, the binding result must not be
reported as a complete success.
## Related Tables
```mermaid