代码暂存 蓝牙连接后上报状态

This commit is contained in:
常正强 2025-05-24 19:06:16 +08:00
parent 58a2335486
commit ca43b87897
3 changed files with 5 additions and 3 deletions

View File

@ -380,6 +380,7 @@ uint16_t Peripheral_ProcessEvent(uint8_t task_id, uint16_t events)
// Restart timer // Restart timer
if(periodic_upload_block_flag == false && mtu_flag == 1) if(periodic_upload_block_flag == false && mtu_flag == 1)
{ {
logWarning("SBP_PERIODIC_EVT");
performPeriodicTask(); performPeriodicTask();
tmos_start_task(Peripheral_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD); tmos_start_task(Peripheral_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD);
} }
@ -491,7 +492,8 @@ static void Peripheral_ProcessTMOSMsg(tmos_event_hdr_t *pMsg)
{ {
peripheralMTU = pMsgEvent->msg.exchangeMTUReq.clientRxMTU; peripheralMTU = pMsgEvent->msg.exchangeMTUReq.clientRxMTU;
mtu_flag = 1; mtu_flag = 1;
logDebug("****mtu exchange: %d****", pMsgEvent->msg.exchangeMTUReq.clientRxMTU); logWarning("****mtu exchange: %d****", pMsgEvent->msg.exchangeMTUReq.clientRxMTU);
performPeriodicTask();
} }
break; break;
} }

View File

@ -126,7 +126,7 @@
#define BLE_MEMHEAP_SIZE (1024*6) #define BLE_MEMHEAP_SIZE (1024*6)
#endif #endif
#ifndef BLE_BUFF_MAX_LEN #ifndef BLE_BUFF_MAX_LEN
#define BLE_BUFF_MAX_LEN 27 #define BLE_BUFF_MAX_LEN 251 // MTU https://www.cnblogs.com/gscw/p/17896209.html
#endif #endif
#ifndef BLE_BUFF_NUM #ifndef BLE_BUFF_NUM
#define BLE_BUFF_NUM 5 #define BLE_BUFF_NUM 5

View File

@ -521,7 +521,7 @@ static int BSP_Module_Connect_CtWing_Handle(at_env_t *e)
{ {
case 0: case 0:
logDebug("create device...\r\n"); logDebug("create device...\r\n");
e->println(e, "AT+MIPOPEN=0,\"TCP\",\"112.125.89.8\",42286,,1"); // 8.135.10.183,32994 e->println(e, "AT+MIPOPEN=0,\"TCP\",\"112.125.89.8\",42519,,1"); // 8.135.10.183,32994
e->reset_timer(e); e->reset_timer(e);
e->state++; e->state++;
break; break;