|
@@ -110,7 +110,7 @@ void wifi_task(void *pvParameters)
|
|
|
uint8 UartDataBuffer[512] = {0};
|
|
|
//TimerHandle_t softTimer1 = xTimerCreate("softTimer1", 10, pdTRUE, (void *)0, vTimerCallback);
|
|
|
Dio_WriteChannel(DioConf_DioChannel_PTD16_GPIO_OUT_MCU_WIFI_POW_EN, STD_ON);//wifi开机
|
|
|
- vTaskDelay(pdMS_TO_TICKS(5000));//开机后等一段时间模块可能会返回开机后的指令 不做处理
|
|
|
+ vTaskDelay(pdMS_TO_TICKS(3000));//开机后等一段时间模块可能会返回开机后的指令 不做处理
|
|
|
wifi_init(0);
|
|
|
#if WIFI_MASTER
|
|
|
tcp_server_process_status = TCP_IDLE;
|
|
@@ -224,8 +224,11 @@ void wifi_task(void *pvParameters)
|
|
|
}
|
|
|
}
|
|
|
/* 解码部分 */
|
|
|
- wifiDataDecode(UartDataBuffer, ReadLen);
|
|
|
-
|
|
|
+ if(ReadLen > 0)
|
|
|
+ {
|
|
|
+ wifiDataDecode(UartDataBuffer, ReadLen);
|
|
|
+ vTaskDelay(pdMS_TO_TICKS(10));
|
|
|
+ }
|
|
|
/* 心跳报文发送 */
|
|
|
static uint64 tickcount = 0;
|
|
|
if(xTaskGetTickCount() - tickcount > pdMS_TO_TICKS(2000))
|
|
@@ -358,7 +361,7 @@ static void wifiDataDecode(uint8 *dataIn,uint16 dataLen)
|
|
|
{
|
|
|
uint8 cmd = 0;
|
|
|
cmd = dataIn[5];
|
|
|
- uint8 sendBuffer[128];
|
|
|
+ uint8 sendBuffer[256];
|
|
|
uint16 dataOutLen = 0;
|
|
|
switch(cmd)
|
|
|
{
|
|
@@ -465,15 +468,15 @@ static void wifi_init(uint8 Step)
|
|
|
}
|
|
|
case 4:
|
|
|
{
|
|
|
- //const char* wifi_init = "\"Hoisting\",\"jx999999\"\r\n";
|
|
|
- const char* wifi_init = "\"123456\",\"12345678\"\r\n";
|
|
|
+ const char* wifi_init = "\"Hoisting\",\"jx999999\"\r\n";
|
|
|
+ //const char* wifi_init = "\"123456\",\"12345678\"\r\n";
|
|
|
WIFI_CMD_INIT(AT_CWJAP,(uint8*)wifi_init,strlen(wifi_init),InitStep,ATRet);
|
|
|
break;
|
|
|
}
|
|
|
case 5:
|
|
|
{
|
|
|
- //const char* wifi_ip_info_init = "\"TCP\",\"192.168.3.177\",5588\r\n";
|
|
|
- const char* wifi_ip_info_init = "\"TCP\",\"192.168.0.13\",5588\r\n";
|
|
|
+ const char* wifi_ip_info_init = "\"TCP\",\"192.168.3.177\",5588\r\n";
|
|
|
+ //const char* wifi_ip_info_init = "\"TCP\",\"192.168.0.13\",5588\r\n";
|
|
|
WIFI_CMD_INIT(AT_CIPSTART,wifi_ip_info_init,strlen(wifi_ip_info_init),InitStep,ATRet);
|
|
|
break;
|
|
|
}
|