fix(vd960DBN): 修复无法设置 IoT 模式的 bug
This commit is contained in:
@@ -535,6 +535,23 @@ static uint8_t unpack_packs(uint8_t *pkg, uint8_t len)
|
||||
}
|
||||
set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, 1);
|
||||
} //end if g_buf_ble_response.cmd == CMD_DBN_MODIFY_PASS
|
||||
else if(g_buf_ble_response.cmd == CMD_DBN_SET_SUB_CODE){
|
||||
g_sub_code_enable.code_set = pkg[4] | (pkg[5] << 8);
|
||||
PRINT("\nWill_set_sub_code:0x%04X\n", g_sub_code_enable.code_set);
|
||||
|
||||
g_sub_code_enable.net_enable = g_sub_code_enable.code_set & 0x01;
|
||||
g_sub_code_enable.iot_enable = (g_sub_code_enable.code_set >> 1) & 0x01;
|
||||
g_sub_code_enable.custom_enable = (g_sub_code_enable.code_set >> 2) & 0x01;
|
||||
g_sub_code_enable.loop_enable = (g_sub_code_enable.code_set >> 3) & 0x01;
|
||||
g_sub_code_enable.dgdus_enable = (g_sub_code_enable.code_set >> 4) & 0x01;
|
||||
g_sub_code_enable.wbdus_enable = (g_sub_code_enable.code_set >> 5) & 0x01;
|
||||
g_sub_code_enable.radar_enable = (g_sub_code_enable.code_set >> 6) & 0x01;
|
||||
g_sub_code_enable.laser_enable = (g_sub_code_enable.code_set >> 9) & 0x01;
|
||||
g_sub_code_enable.lora_enable = (g_sub_code_enable.code_set >> 15) & 0x01;
|
||||
|
||||
|
||||
update_sub_code_enable();
|
||||
}
|
||||
else if(g_buf_ble_response.cmd == CMD_DBN_SET_IOT_NET)
|
||||
{
|
||||
for(i = 0, j = 0, k = 0; i < g_buf_ble_response.dat_len; i++)
|
||||
@@ -751,6 +768,11 @@ void manage_dbn_ble_default(uint8_t *pkg, uint8_t len)
|
||||
{
|
||||
set_response_iot_topic(&g_buf_ble_response);
|
||||
} break;
|
||||
case CMD_DBN_SET_SUB_CODE:
|
||||
{
|
||||
PRINT("\nSet_Sub_Code\n");
|
||||
unpack_packs(pkg, len);
|
||||
} break;
|
||||
case CMD_DBN_RESET_DEV:
|
||||
{
|
||||
//Restart Dev
|
||||
|
||||
Reference in New Issue
Block a user