From 6a54fd6dd7b40c274b68b0f27bedb7b71b7a21c5 Mon Sep 17 00:00:00 2001
From: yincheng.zhong <634916154@qq.com>
Date: 星期一, 26 八月 2024 09:39:41 +0800
Subject: [PATCH] 调试4G唤醒,和服务器下发解析

---
 keil/include/components/internet/src/AIR780EDriver.c |   64 ++++++++++++++++++-------------
 1 files changed, 37 insertions(+), 27 deletions(-)

diff --git a/keil/include/components/internet/src/AIR780EDriver.c b/keil/include/components/internet/src/AIR780EDriver.c
index ee7ad60..019d970 100644
--- a/keil/include/components/internet/src/AIR780EDriver.c
+++ b/keil/include/components/internet/src/AIR780EDriver.c
@@ -333,11 +333,13 @@
     {
         if((_pstATDevice->m_u32LineLen > 0) && (_pstATDevice->m_pcLineBuf[_pstATDevice->m_u32LineLen - 1] == '\n'))
         {
-            HIDO_Debug( "[AT Recv] %s", _pstATDevice->m_pcLineBuf);
+            LOG_INFO(TRACE_MODULE_APP, "[AT Recv] %s", _pstATDevice->m_pcLineBuf);
+            //HIDO_Debug( "[AT Recv] %s", _pstATDevice->m_pcLineBuf);
         }
         else
         {
-            HIDO_Debug("[AT Recv] %s\r\n", _pstATDevice->m_pcLineBuf);
+            LOG_INFO(TRACE_MODULE_APP, "[AT Recv] %s\r\n", _pstATDevice->m_pcLineBuf);
+            //HIDO_Debug("[AT Recv] %s\r\n", _pstATDevice->m_pcLineBuf);
         }
     }
 
@@ -364,11 +366,13 @@
 		{
 		    if((_u32Len > 0) && (_pu8Data[_u32Len - 1] == '\n'))
 		    {
-		        HIDO_Debug("[AT Send] %s", _pu8Data);
+		        // HIDO_Debug("[AT Send] %s", _pu8Data);
+                LOG_INFO(TRACE_MODULE_APP, "[AT Send] %s", _pu8Data);
 		    }
 		    else
 		    {
-		        HIDO_Debug("[AT Send] %s\r\n", _pu8Data);
+		        // HIDO_Debug("[AT Send] %s\r\n", _pu8Data);
+                LOG_INFO(TRACE_MODULE_APP, "[AT Send] %s", _pu8Data);
 		    }
 		}
 	}
@@ -407,8 +411,8 @@
  *******************************************************************************/
 HIDO_INT32 AIR780EDriver_PowerOn(void)
 {
-    gpio_pin_set(l_stAIR780EPin[AIR780E_PIN_3V8_EN]);
-
+    air780_power_state = 1;
+    update_led_power_state();
     return HIDO_OK;
 }
 
@@ -423,8 +427,8 @@
  *******************************************************************************/
 HIDO_INT32 AIR780EDriver_PowerOff(void)
 {
-    gpio_pin_clr(l_stAIR780EPin[AIR780E_PIN_3V8_EN]);
-
+    air780_power_state = 0;
+    update_led_power_state();
     return HIDO_OK;
 }
 
@@ -524,7 +528,8 @@
     vsnprintf(acBuff, sizeof(acBuff), _pcFmt, _ap);
     
   //  HIDO_Log(HIDO_LOG_LEVEL_DEBUG, "%s", acBuff);
-    HIDO_Debug(acBuff);
+    //HIDO_Debug(acBuff);
+    LOG_INFO(TRACE_MODULE_APP, acBuff);
 
     return HIDO_OK;
 }
@@ -546,21 +551,6 @@
 }
 
 /*******************************************************************************
- * Function Name     : AIR780EDriver_TimerPoll
- * Description       :
- * Input             :
- * Output            :
- * Return            :
- * Author            : 杜键
- * Modified Date:    : 2018年5月22日
- *******************************************************************************/
-void AIR780EDriver_TimerPoll(void)
-{
-    //HIDO_TimerPollByID(l_stDriverData.m_u32FSMTimerID);
-    //HIDO_TimerPollByID(l_stAIR780EDevice.m_u32TimerID);
-}
-
-/*******************************************************************************
  * Function Name     : AIR780EDriver_Init
  * Description       :
  * Input             :
@@ -569,18 +559,38 @@
  * Author            : 杜键
  * Modified Date:    : 2018年5月22日
  *******************************************************************************/
-HIDO_INT32 AIR780EDriver_Init(void)
+void AIR780EUartInit(void)
 {
-    ST_UartInit stUartInit;
+io_pin_mux_set(_4G_USART_RX_Pin,IO_FUNC4);
+ ST_UartInit stUartInit;
 
     /* 串口初始化 */
-    stUartInit.m_eRxMode = UART_RX_MODE_DMA;
+    stUartInit.m_eRxMode = UART_RX_MODE_INT;
     stUartInit.m_eTxMode = UART_TX_MODE_POLL;
     stUartInit.m_pu8RxBuf = l_au8AIR780EUartRxBuf;
     stUartInit.m_u32RxBufSize = AIR780E_UART_RX_BUF_SIZE;
     stUartInit.m_pu8TxBuf = l_au8AIR780EUartTxBuf;
     stUartInit.m_u32TxBufSize = AIR780E_UART_TX_BUF_SIZE;
     stUartInit.m_u32TxQueueMemberCnt = AIR780E_UART_TX_QUEUE_MEMBER_CNT;
+    stUartInit.m_u32BaudRate = 9600;
+    if(Uart_Init(UART_ID_4G, &stUartInit) != HIDO_OK)
+    {
+       
+    }
+}
+HIDO_INT32 AIR780EDriver_Init(void)
+{
+    ST_UartInit stUartInit;
+
+    /* 串口初始化 */
+    stUartInit.m_eRxMode = UART_RX_MODE_INT;
+    stUartInit.m_eTxMode = UART_TX_MODE_POLL;
+    stUartInit.m_pu8RxBuf = l_au8AIR780EUartRxBuf;
+    stUartInit.m_u32RxBufSize = AIR780E_UART_RX_BUF_SIZE;
+    stUartInit.m_pu8TxBuf = l_au8AIR780EUartTxBuf;
+    stUartInit.m_u32TxBufSize = AIR780E_UART_TX_BUF_SIZE;
+    stUartInit.m_u32TxQueueMemberCnt = AIR780E_UART_TX_QUEUE_MEMBER_CNT;
+    stUartInit.m_u32BaudRate = 9600;
     if(Uart_Init(UART_ID_4G, &stUartInit) != HIDO_OK)
     {
         return HIDO_ERR;

--
Gitblit v1.9.3