添加mqtt插入卡片和设备绑定
This commit is contained in:
@@ -110,6 +110,7 @@ async def bind_nfc(
|
||||
req: NFCBindRequest,
|
||||
current_user_id: int = Depends(get_current_user_id)
|
||||
):
|
||||
# 扫码绑定卡片需要发送NFC绑定命令
|
||||
service = await _get_service()
|
||||
msg_id = await service.send_bind_nfc_command(req.device_id, req.uuid)
|
||||
return CommandResponse(msg_id=msg_id, device_id=req.device_id)
|
||||
|
||||
@@ -165,6 +165,8 @@ class TalkingQMQTTService:
|
||||
logger.info(device_id, "", f"[NFC绑定] 设备 {device_id} 请求绑定卡片返回状态: {status}")
|
||||
|
||||
nfc_uuid = params.get("uuid")
|
||||
# 卡片与设备绑定
|
||||
await card_service.activate_card(device_id=device_id, card_uuid=nfc_uuid)
|
||||
logger.info(device_id, "", f"[NFC绑定] 设备 {device_id} 请求绑定卡片, UUID={nfc_uuid}")
|
||||
|
||||
async def _handle_open_response(self, device_id: str, payload: dict):
|
||||
|
||||
Reference in New Issue
Block a user