|
|
@@ -101,9 +101,11 @@ int data_send_to_pc(pc_cmd_type cmd, char *data, unsigned short len)
|
|
|
|
|
|
if((sysinf.pc_channel_recv == PC_CONNECT_TYPE_WIFI || cmd == PC_CMD_SETIP ) && ((PC_CMD_SETWIFI != cmd) && (PC_CMD_UPDATETEMP != cmd) && (PC_CMD_DATASCOPE != cmd)))
|
|
|
{
|
|
|
- wifi_tx_len = sendlen;
|
|
|
- memcpy(wifi_tx_buf, com_tx_buf, wifi_tx_len);
|
|
|
- return WIFI_ReSend();
|
|
|
+ if(wifi_tx_len == 0){
|
|
|
+ wifi_tx_len = sendlen;
|
|
|
+ memcpy(wifi_tx_buf, com_tx_buf, wifi_tx_len);
|
|
|
+ return WIFI_ReSend();
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -129,20 +131,22 @@ int data_send_to_pc_withindex(pc_cmd_type cmd, char *data, unsigned short len, u
|
|
|
check += checkSum((const unsigned char *)data, len);
|
|
|
msg.checksum = check & 0xFF;
|
|
|
msg.tail = (check >> 8);
|
|
|
- if(check_to_pc_busy()){
|
|
|
- memcpy(&wifi_tx_buf[0], (uint8_t*)&msg, MSG_CMDFRAME_LEN);
|
|
|
- memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN], data, len);
|
|
|
- memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN+len], (uint8_t*)&check, 2);
|
|
|
- }else{
|
|
|
- return ret;
|
|
|
- }
|
|
|
+
|
|
|
if((sysinf.pc_channel_recv == PC_CONNECT_TYPE_WIFI || cmd == PC_CMD_SETIP ) && PC_CMD_SETWIFI != cmd)
|
|
|
{
|
|
|
- wifi_tx_len = MSG_CMDFRAME_LEN+len+2;
|
|
|
- return WIFI_ReSend();
|
|
|
+ if(wifi_tx_len == 0){
|
|
|
+ memcpy(&wifi_tx_buf[0], (uint8_t*)&msg, MSG_CMDFRAME_LEN);
|
|
|
+ memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN], data, len);
|
|
|
+ memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN+len], (uint8_t*)&check, 2);
|
|
|
+ wifi_tx_len = MSG_CMDFRAME_LEN+len+2;
|
|
|
+ return WIFI_ReSend();
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ memcpy(&wifi_tx_buf[0], (uint8_t*)&msg, MSG_CMDFRAME_LEN);
|
|
|
+ memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN], data, len);
|
|
|
+ memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN+len], (uint8_t*)&check, 2);
|
|
|
wifi_tx_len = MSG_CMDFRAME_LEN+len+2;
|
|
|
Van_Debug_UART_Send_DMA((unsigned char *)wifi_tx_buf, wifi_tx_len); //将收到的信息发送出
|
|
|
memset(wifi_tx_buf, 0, sizeof(wifi_tx_buf));
|