* companion: added CMD_SET_DEVICE_PIN

这个提交包含在:
Scott Powell
2025-03-19 17:54:55 +11:00
父节点 089ac96f2b
当前提交 4aeafbd034
+6
查看文件
@@ -184,6 +184,7 @@ static uint32_t _atoi(const char* sp) {
#define CMD_SIGN_DATA 34
#define CMD_SIGN_FINISH 35
#define CMD_SEND_TRACE_PATH 36
#define CMD_SET_DEVICE_PIN 37
#define RESP_CODE_OK 0
#define RESP_CODE_ERR 1
@@ -1402,6 +1403,11 @@ public:
} else {
writeErrFrame(ERR_CODE_TABLE_FULL);
}
} else if (cmd_frame[0] == CMD_SET_DEVICE_PIN && len > 1) {
cmd_frame[len] = 0; // make C string
_prefs.ble_pin = _atoi((char *) &cmd_frame[1]);
savePrefs();
writeOKFrame();
} else {
writeErrFrame(ERR_CODE_UNSUPPORTED_CMD);
MESH_DEBUG_PRINTLN("ERROR: unknown command: %02X", cmd_frame[0]);