优化蓝牙配网流程,优化主题订阅流程
This commit is contained in:
parent
a74a0e9a68
commit
894f88b9a8
|
@ -50,7 +50,7 @@
|
||||||
<InvalidFlash>1</InvalidFlash>
|
<InvalidFlash>1</InvalidFlash>
|
||||||
</TargetStatus>
|
</TargetStatus>
|
||||||
<OutputDirectory>.\Objects\</OutputDirectory>
|
<OutputDirectory>.\Objects\</OutputDirectory>
|
||||||
<OutputName>BCU14</OutputName>
|
<OutputName>BCU15</OutputName>
|
||||||
<CreateExecutable>1</CreateExecutable>
|
<CreateExecutable>1</CreateExecutable>
|
||||||
<CreateLib>0</CreateLib>
|
<CreateLib>0</CreateLib>
|
||||||
<CreateHexFile>1</CreateHexFile>
|
<CreateHexFile>1</CreateHexFile>
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
<AfterMake>
|
<AfterMake>
|
||||||
<RunUserProg1>1</RunUserProg1>
|
<RunUserProg1>1</RunUserProg1>
|
||||||
<RunUserProg2>0</RunUserProg2>
|
<RunUserProg2>0</RunUserProg2>
|
||||||
<UserProg1Name>D:\CodeHvStack\BCU\app\stm32fxxx_app\hex2bin.exe D:\CodeHvStack\BCU\app\stm32fxxx_app\prj\Objects\BCU14.hex</UserProg1Name>
|
<UserProg1Name>D:\CodeHvStack\BCU\app\stm32fxxx_app\hex2bin.exe D:\CodeHvStack\BCU\app\stm32fxxx_app\prj\Objects\BCU15.hex</UserProg1Name>
|
||||||
<UserProg2Name></UserProg2Name>
|
<UserProg2Name></UserProg2Name>
|
||||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1100,7 +1100,7 @@ void protocol_build_temp_json(uint8_t i, uint32_t time)
|
||||||
if (json_str)
|
if (json_str)
|
||||||
{
|
{
|
||||||
drv_mqtt_publish_no_respose(json_str, strlen(json_str));
|
drv_mqtt_publish_no_respose(json_str, strlen(json_str));
|
||||||
bsp_task_delay_ms(10.0);
|
bsp_task_delay_ms(100);
|
||||||
cJSON_free(json_str);
|
cJSON_free(json_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1144,6 +1144,7 @@ void mqtt_publish_bms_data(uint32_t basetime)
|
||||||
static uint32_t mqtt_cycle_tick = 0;
|
static uint32_t mqtt_cycle_tick = 0;
|
||||||
//static uint16_t mqtt_init_count = 0;
|
//static uint16_t mqtt_init_count = 0;
|
||||||
static uint8_t mqtt_init_flag = 1;
|
static uint8_t mqtt_init_flag = 1;
|
||||||
|
static uint8_t sub_read_control_flag = 1;
|
||||||
static uint8_t groupMax = 0;
|
static uint8_t groupMax = 0;
|
||||||
|
|
||||||
mqtt_cycle_tick += basetime;
|
mqtt_cycle_tick += basetime;
|
||||||
|
@ -1173,14 +1174,13 @@ void mqtt_publish_bms_data(uint32_t basetime)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// 定期检测是否依然订阅主题
|
// 定期检测是否依然订阅主题
|
||||||
// if (!drv_at_send_cmd("AT+QMTSUB=?", "control\0", WIFI_TIMEOUT))
|
if (sub_read_control_flag == 1)
|
||||||
// {
|
{
|
||||||
// drv_at_send_cmd("AT+QMTSUB=0,1,\"bluesun/bms/control/11223344\",0,\"bluesun/bms/read/11223344\",0", "OK", WIFI_TIMEOUT);
|
if (drv_at_send_cmd("AT+QMTSUB=0,1,\"bluesun/bms/control/11223344\",0,\"bluesun/bms/read/11223344\",0", "OK", WIFI_TIMEOUT))
|
||||||
// }
|
{
|
||||||
// if (!drv_at_send_cmd("AT+QMTSUB=?", "read\0", WIFI_TIMEOUT))
|
sub_read_control_flag = 0;
|
||||||
// {
|
}
|
||||||
// drv_at_send_cmd("AT+QMTSUB=0,1,\"bluesun/bms/control/11223344\",0,\"bluesun/bms/read/11223344\",0", "OK", WIFI_TIMEOUT);
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// 定期检测是否蓝牙断连
|
// 定期检测是否蓝牙断连
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -176,6 +176,11 @@ void drv_mqtt_publish(const char *topic, const char *message)
|
||||||
int main(void) {
|
int main(void) {
|
||||||
SystemInit();
|
SystemInit();
|
||||||
drv_uart2_Init();
|
drv_uart2_Init();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
drv_eg25g_init();
|
drv_eg25g_init();
|
||||||
drv_mqtt_connect();
|
drv_mqtt_connect();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue