测试了PDP移除重连的问题.暂作为沈阳6套安装程序

This commit is contained in:
小马_666 2025-01-05 11:16:18 +08:00
parent 21c9ac1ba9
commit c0cd2cd015
2 changed files with 12 additions and 12 deletions

View File

@ -2,7 +2,7 @@
* @Author : stark1898y 1658608470@qq.com
* @Date : 2024-09-04 13:33:49
* @LastEditors: mbw && 1600520629@qq.com
* @LastEditTime: 2025-01-04 17:51:47
* @LastEditTime: 2025-01-05 11:10:16
* @FilePath: \ble_bjq_ch303rct6_ml307\bsp\src\at_device_ml307.c
* @Description :
*
@ -101,11 +101,11 @@ static rt_err_t ml307_power_off(struct at_device *device)
rt_err_t Ml307_Reset(struct at_device *device)
{
rt_pin_write(ML307_RST_PIN, PIN_HIGH);
rt_thread_mdelay(500);
rt_pin_write(ML307_RST_PIN, PIN_LOW);
rt_sem_release(ml307_disconnect_sem);
// at_client_send("AT+MREBOOT\r\n", rt_strlen("AT+MREBOOT\r\n"));
// rt_pin_write(ML307_RST_PIN, PIN_HIGH);
// rt_thread_mdelay(500);
// rt_pin_write(ML307_RST_PIN, PIN_LOW);
// rt_sem_release(ml307_disconnect_sem);
at_client_send("AT+MREBOOT\r\n", rt_strlen("AT+MREBOOT\r\n"));
return RT_EOK;
}
@ -238,7 +238,7 @@ static void urc_tcp_disconnect(struct at_client *client, const char *data, rt_si
void urc_sim_remove(struct at_client *client, const char *data, rt_size_t size)
{
LOG_D("SIM removed");
Send_Laser_Alarm_Event(kFaultEvent);
ml307_conncet_tcp_flag = 0;
}
static const struct at_urc urc_table[] = {
{"REBOOTING", "\r\n", urc_device_reset}, // 这个是软件复位时,
@ -246,7 +246,7 @@ static const struct at_urc urc_table[] = {
{"+MIPURC: \"disconn\"", "\r\n", urc_tcp_disconnect},
{"+MIPURC: \"rtcp\"", "\r\n", urc_tcp_recv},
{"+MATREADY", "\r\n", urc_device_reset},
// {"+CPIN: SIM REMOVED", "\r\n", urc_sim_remove},
{"+CPIN: SIM REMOVED", "\r\n", urc_sim_remove},
};
void show_resp_info(at_response_t resp)

View File

@ -2,7 +2,7 @@
* @Author: mbw
* @Date: 2024-11-30 15:46:21
* @LastEditors: mbw && 1600520629@qq.com
* @LastEditTime: 2025-01-04 17:23:49
* @LastEditTime: 2025-01-05 11:11:29
* @FilePath: \ble_bjq_ch303rct6_ml307\bsp\src\bsp_ml307.c
* @Description:
*
@ -1666,7 +1666,6 @@ static void Ml307_Recv_Thread_Entry(void *parameter)
static void Ml307_Life_Thread_Entry(void *parameter)
{
struct at_device_ml307 *ml307 = &_dev;
struct at_device *device = at_device_get_by_name(AT_DEVICE_NAMETYPE_NETDEV, ml307->device_name);
RT_ASSERT(device);
@ -1682,6 +1681,7 @@ static void Ml307_Life_Thread_Entry(void *parameter)
LOG_D("重连网络中...\n");
if (ml307_conncet_tcp_flag != RT_TRUE)
{
device->class->device_ops->control(device, AT_DEVICE_CTRL_RESET, RT_NULL); // 先关闭,再处理
if(ml307_disconnect_pdp_flag)
{
at_response_t resp = at_create_resp(32, 0, 5000);
@ -1693,7 +1693,7 @@ static void Ml307_Life_Thread_Entry(void *parameter)
at_obj_exec_cmd(device->client, resp, "AT+MIPCALL=1,1");
at_delete_resp(resp);
}
device->class->device_ops->control(device, AT_DEVICE_CTRL_NET_DISCONN, RT_NULL); // 先关闭,再处理
if (device->class->device_ops->control(device, AT_DEVICE_CTRL_NET_CONN, RT_NULL) == RT_EOK)
{
LOG_D("重连网络成功\n");
@ -1702,7 +1702,7 @@ static void Ml307_Life_Thread_Entry(void *parameter)
else
{
LOG_D("重连网络失败\n");
rt_thread_mdelay(10000);
rt_thread_mdelay(5000);
rt_sem_release(ml307_disconnect_sem);
}
}