加了当在平台未注册IMEI号时,绿灯闪烁
This commit is contained in:
parent
4e7e2ea37f
commit
71cbb44efd
|
@ -205,6 +205,7 @@ extern rt_sem_t nt26k_recv_sem;
|
||||||
extern rt_sem_t nt26k_recv_heart_sem;
|
extern rt_sem_t nt26k_recv_heart_sem;
|
||||||
extern rt_sem_t nt26k_disconnect_sem;
|
extern rt_sem_t nt26k_disconnect_sem;
|
||||||
extern rt_uint8_t nt26k_conncet_tcp_flag;
|
extern rt_uint8_t nt26k_conncet_tcp_flag;
|
||||||
|
extern rt_uint8_t nt26k_connect_sever_flag;
|
||||||
extern rt_uint8_t nt26k_disconnect_pdp_flag;
|
extern rt_uint8_t nt26k_disconnect_pdp_flag;
|
||||||
extern rt_uint8_t power_on_send_flag;
|
extern rt_uint8_t power_on_send_flag;
|
||||||
int BSP_Nt26k_Thread_Init(void);
|
int BSP_Nt26k_Thread_Init(void);
|
||||||
|
|
|
@ -27,11 +27,11 @@ static void BSP_Led_thread_entry(void *param)
|
||||||
{
|
{
|
||||||
if (SysControl.status == kNormalDetectionEvents)
|
if (SysControl.status == kNormalDetectionEvents)
|
||||||
{
|
{
|
||||||
if ((nt26k_conncet_tcp_flag))
|
if ((nt26k_conncet_tcp_flag == 1) && nt26k_connect_sever_flag == 1)
|
||||||
{
|
{
|
||||||
LED_G_NORMAL;
|
LED_G_NORMAL;
|
||||||
}
|
}
|
||||||
else if ((!nt26k_conncet_tcp_flag))
|
else
|
||||||
{
|
{
|
||||||
LED_STOP(r);
|
LED_STOP(r);
|
||||||
LED_STOP(g);
|
LED_STOP(g);
|
||||||
|
@ -46,7 +46,7 @@ static void BSP_Led_thread_entry(void *param)
|
||||||
{
|
{
|
||||||
if (SysControl.last_status == kNormalDetectionEvents)
|
if (SysControl.last_status == kNormalDetectionEvents)
|
||||||
{
|
{
|
||||||
if ((nt26k_conncet_tcp_flag))
|
if ((nt26k_conncet_tcp_flag == 1) && nt26k_connect_sever_flag == 1)
|
||||||
{
|
{
|
||||||
LED_G_NORMAL;
|
LED_G_NORMAL;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ static void BSP_Led_thread_entry(void *param)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rt_thread_mdelay(1000);
|
rt_thread_mdelay(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int BSP_LED_Init(void)
|
int BSP_LED_Init(void)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @Author: mbw
|
* @Author: mbw
|
||||||
* @Date: 2024-10-09 08:42:14
|
* @Date: 2024-10-09 08:42:14
|
||||||
* @LastEditors: mbw && 1600520629@qq.com
|
* @LastEditors: mbw && 1600520629@qq.com
|
||||||
* @LastEditTime: 2025-01-17 14:10:00
|
* @LastEditTime: 2025-01-17 15:04:55
|
||||||
* @FilePath: \JT-DT-YD4N02A_RTT_MRS-NT26K\bsp\src\bsp_nt26k.c
|
* @FilePath: \JT-DT-YD4N02A_RTT_MRS-NT26K\bsp\src\bsp_nt26k.c
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
|
@ -45,6 +45,7 @@
|
||||||
#define NT26K_LIFE_THREAD_PRIORITY 26
|
#define NT26K_LIFE_THREAD_PRIORITY 26
|
||||||
#define NT26K_LIFE_THREAD_TICKS 10
|
#define NT26K_LIFE_THREAD_TICKS 10
|
||||||
|
|
||||||
|
|
||||||
// static rt_uint32_t nt26k_status = 0;
|
// static rt_uint32_t nt26k_status = 0;
|
||||||
ALIGN(RT_ALIGN_SIZE)
|
ALIGN(RT_ALIGN_SIZE)
|
||||||
static char nt26k_thread_stack[NT26K_THREAD_STACK_SIZE];
|
static char nt26k_thread_stack[NT26K_THREAD_STACK_SIZE];
|
||||||
|
@ -66,6 +67,7 @@ static rt_timer_t nt26k_timer; // 上报心跳
|
||||||
static rt_timer_t nt26k_upload_timer; // 更新本地时间定时器
|
static rt_timer_t nt26k_upload_timer; // 更新本地时间定时器
|
||||||
static rt_timer_t nt26k_power_error_timer; // 上电失败情况下启动定时器
|
static rt_timer_t nt26k_power_error_timer; // 上电失败情况下启动定时器
|
||||||
|
|
||||||
|
rt_uint8_t nt26k_connect_sever_flag;
|
||||||
rt_uint8_t nt26k_conncet_tcp_flag;
|
rt_uint8_t nt26k_conncet_tcp_flag;
|
||||||
rt_uint8_t nt26k_disconnect_pdp_flag; // PDP断开连接标志
|
rt_uint8_t nt26k_disconnect_pdp_flag; // PDP断开连接标志
|
||||||
rt_uint8_t nt26k_disconnect_retry_flag = 0; // 用于判断是否已经启动了重连,如果启动,不需要每次都进入
|
rt_uint8_t nt26k_disconnect_retry_flag = 0; // 用于判断是否已经启动了重连,如果启动,不需要每次都进入
|
||||||
|
@ -811,6 +813,7 @@ int Nt26k_Process_Events(Nt26kEvent nt26k_recv_event, struct at_device *device,
|
||||||
if (rt_sem_take(nt26k_recv_heart_sem, 5000) == RT_EOK)
|
if (rt_sem_take(nt26k_recv_heart_sem, 5000) == RT_EOK)
|
||||||
{
|
{
|
||||||
LOG_D("收到心跳回复\n");
|
LOG_D("收到心跳回复\n");
|
||||||
|
nt26k_connect_sever_flag = 1;
|
||||||
return RT_EOK; // 函数执行完毕,返回0
|
return RT_EOK; // 函数执行完毕,返回0
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -818,6 +821,7 @@ int Nt26k_Process_Events(Nt26kEvent nt26k_recv_event, struct at_device *device,
|
||||||
LOG_E("nt26k send cmd failed\n"); // 收不到说明断网了,重连下10s后再发送
|
LOG_E("nt26k send cmd failed\n"); // 收不到说明断网了,重连下10s后再发送
|
||||||
LOG_D("rt_sem_release (nt26k_disconnect_sem)");
|
LOG_D("rt_sem_release (nt26k_disconnect_sem)");
|
||||||
nt26k_conncet_tcp_flag = 0;
|
nt26k_conncet_tcp_flag = 0;
|
||||||
|
nt26k_connect_sever_flag =0;
|
||||||
rt_thread_mdelay(1);
|
rt_thread_mdelay(1);
|
||||||
rt_sem_release(nt26k_disconnect_sem);
|
rt_sem_release(nt26k_disconnect_sem);
|
||||||
rt_thread_mdelay(5000);
|
rt_thread_mdelay(5000);
|
||||||
|
|
Loading…
Reference in New Issue