This commit is contained in:
小马_666 2025-06-04 10:49:58 +08:00
parent edd102e387
commit ee8dc69fb9
3 changed files with 13 additions and 5 deletions

View File

@ -348,6 +348,7 @@ int at_send_data(struct at_device *device, const char *data, rt_size_t send_len)
size_t len = 0, error_code; size_t len = 0, error_code;
#define ML307_SEND_RESP_TIME (5000) #define ML307_SEND_RESP_TIME (5000)
at_response_t resp = at_create_resp(AT_CLIENT_RECV_BUFF_LEN, 0, ML307_SEND_RESP_TIME); at_response_t resp = at_create_resp(AT_CLIENT_RECV_BUFF_LEN, 0, ML307_SEND_RESP_TIME);
if (resp == RT_NULL) if (resp == RT_NULL)
@ -368,6 +369,13 @@ int at_send_data(struct at_device *device, const char *data, rt_size_t send_len)
return RT_EOK; return RT_EOK;
} }
} }
else if (at_resp_parse_line_args_by_kw(resp, "+CME ERROR:", "+CME ERROR: %d", &error_code) > 0)
{
ml307_conncet_tcp_flag = 0;
LOG_E("send data fail error_code: %d", error_code);
at_delete_resp(resp);
return -RT_ERROR;
}
} }
else if (at_resp_parse_line_args_by_kw(resp, "+CME ERROR:", "+CME ERROR: %d", &error_code) > 0) else if (at_resp_parse_line_args_by_kw(resp, "+CME ERROR:", "+CME ERROR: %d", &error_code) > 0)
{ {

View File

@ -951,7 +951,6 @@ int Ml307_Process_Events (Ml307Event ml307_recv_event, struct at_device *device,
if (event) // 处理该事件 if (event) // 处理该事件
{ {
// 打印事件的名称 // 打印事件的名称
ml307_current_evnet = event->event_flag; ml307_current_evnet = event->event_flag;
for (size_t i = 0; i < max_retry_count; i++) for (size_t i = 0; i < max_retry_count; i++)
{ {
@ -992,6 +991,7 @@ int Ml307_Process_Events (Ml307Event ml307_recv_event, struct at_device *device,
else else
{ {
ret = RT_ERROR; ret = RT_ERROR;
break;
} }
if (event->priority < Get_Event_Priority (ml307_latest_evnet)) // 查看当前事件和新传入的事件的优先级哪个高,如果有高的直接退出处理高优先级的 if (event->priority < Get_Event_Priority (ml307_latest_evnet)) // 查看当前事件和新传入的事件的优先级哪个高,如果有高的直接退出处理高优先级的
{ {
@ -1025,7 +1025,7 @@ int Ml307_Process_Events (Ml307Event ml307_recv_event, struct at_device *device,
if (!ml307_disconnect_retry_flag) if (!ml307_disconnect_retry_flag)
{ {
LOG_D("与服务器断开,重连网络中"); LOG_D("与服务器断开,重连网络中");
rt_sem_release (ml307_disconnect_sem); rt_sem_release (ml307_disconnect_sem);
} }
else else
{ {
@ -2015,7 +2015,7 @@ static void Ml307_Life_Thread_Entry (void *parameter)
} }
} }
} }
rt_thread_mdelay (3000); rt_thread_mdelay (1000);
} }
if (i == 60) if (i == 60)
{ {

View File

@ -88,7 +88,7 @@
#define FINSH_THREAD_NAME "tshell" #define FINSH_THREAD_NAME "tshell"
#define FINSH_THREAD_PRIORITY 11 #define FINSH_THREAD_PRIORITY 11
#define FINSH_THREAD_STACK_SIZE 4096 #define FINSH_THREAD_STACK_SIZE 3072
#define FINSH_USING_HISTORY #define FINSH_USING_HISTORY
#define FINSH_HISTORY_LINES 5 #define FINSH_HISTORY_LINES 5
#define FINSH_USING_SYMTAB #define FINSH_USING_SYMTAB