与APP协议通讯验证,并添加获取与修改wifi、ble设置命令
This commit is contained in:
@@ -213,7 +213,13 @@ int resend_send_data(resend_device_t *resend_device, uint8_t cmd, void* data, ui
|
||||
resend_device->tx_frame.retry_cnt ++;
|
||||
|
||||
// 接收数据
|
||||
resend_recv_data(resend_device, timeout);
|
||||
uint16_t timeout_lat = timeout + 1;
|
||||
while(timeout_lat --)
|
||||
{
|
||||
if(resend_recv_data(resend_device, 0) > 0)
|
||||
break;
|
||||
os_thread_sleep(1);
|
||||
}
|
||||
// 超过允许的等待次数
|
||||
if(resend_device->tx_frame.retry_cnt > RESEND_MAX_RETRY_CNT)
|
||||
{
|
||||
@@ -232,26 +238,20 @@ int resend_parse_data(resend_device_t *resend_device)
|
||||
{
|
||||
switch(resend_device->rx_frame.cmd){
|
||||
case RESEND_CMD_DATA:
|
||||
for (size_t i = 0; i < resend_device->rx_frame.len; i++)
|
||||
{
|
||||
printf("%02X ", resend_device->rx_frame.payload[i]);
|
||||
}
|
||||
printf("\r\n");
|
||||
break;
|
||||
case RESEND_CMD_ACK:
|
||||
printf("ACK\n");
|
||||
resend_device->status.ack_flag = 0;
|
||||
break;
|
||||
case RESEND_CMD_GET_STATUS:
|
||||
resend_send_cmd(resend_device, RESEND_CMD_ACK, 0);
|
||||
resend_device->handle_flag = RESEND_CMD_GET_STATUS;
|
||||
break;
|
||||
case RESEND_CMD_STATUS:
|
||||
case RESEND_CMD_PARAM:
|
||||
resend_set(resend_device);
|
||||
resend_send_cmd(resend_device, RESEND_CMD_ACK, 0);
|
||||
break;
|
||||
case RESEND_CMD_SET_STATUS:
|
||||
case RESEND_CMD_GET_PARAM:
|
||||
resend_send_cmd(resend_device, RESEND_CMD_ACK, 0);
|
||||
resend_device->handle_flag = RESEND_CMD_GET_PARAM;
|
||||
break;
|
||||
case RESEND_CMD_SET_PARAM:
|
||||
break;
|
||||
case RESEND_CMD_DATA_ACK:
|
||||
for (size_t i = 0; i < resend_device->rx_frame.len; i++)
|
||||
|
||||
Reference in New Issue
Block a user