Просмотр исходного кода

【修改】chat log 打印等级
【修改】ppp_device 打印信息

Signed-off-by: liuxianliang <liuxianliang@rt-thread.com>

liuxianliang 6 лет назад
Родитель
Сommit
ecfce331a9
2 измененных файлов с 7 добавлено и 8 удалено
  1. 2 2
      src/ppp_chat.c
  2. 5 6
      src/ppp_device.c

+ 2 - 2
src/ppp_chat.c

@@ -240,7 +240,7 @@ rt_err_t modem_chat(rt_device_t serial, const struct modem_chat_data *data, rt_s
     old_rx_ind = serial->rx_indicate;
     rt_device_set_rx_indicate(serial, chat_rx_ind);
 
-    LOG_I("(%s) has control by modem_chat.", serial->parent.name);
+    LOG_D("(%s) has control by modem_chat.", serial->parent.name);
     err = modem_chat_internal(serial, data, len);
     if (err != RT_EOK)
     {
@@ -248,6 +248,6 @@ rt_err_t modem_chat(rt_device_t serial, const struct modem_chat_data *data, rt_s
     }
 
     serial->rx_indicate = old_rx_ind;
-    LOG_I("(%s) has control by ppp_device.", serial->parent.name);
+    LOG_D("(%s) has control by ppp_device.", serial->parent.name);
     return err;
 }

+ 5 - 6
src/ppp_device.c

@@ -45,7 +45,6 @@ enum
 #error "tcpip stack is too small, should greater than 2048."
 #endif
 
-
 static struct ppp_device *_g_ppp_device = RT_NULL;
 
 /*
@@ -161,7 +160,7 @@ static void ppp_status_changed(ppp_pcb *pcb, int err_code, void *ctx)
     case PPPERR_NONE: /* Connected */
         pppdev->pppif.mtu = pppif->mtu;
         ppp_netdev_refresh(&pppdev->pppif);
-        LOG_I("ppp connect successful.");
+        LOG_I("ppp_device connect successfully.");
         break;
     case PPPERR_PARAM:
         LOG_E("Invalid parameter.");
@@ -520,10 +519,10 @@ __exit:
     return result;
 }
 
-/*
+/**
  * ppp device init function,set ops funciton and base config
  *
- * @param rt_device_t *device
+ * @param dev the pointer of device driver structure
  *
  *
  * @return  0: execute successful
@@ -584,7 +583,7 @@ static rt_err_t ppp_device_open(struct rt_device *device, rt_uint16_t oflag)
 
     /* uart transfer into tcpip protocol stack */
     rt_device_set_rx_indicate(ppp_device->uart, ppp_device_rx_ind);
-    LOG_I("(%s) is used by ppp_device.", ppp_device->uart->parent.name);
+    LOG_D("(%s) is used by ppp_device.", ppp_device->uart->parent.name);
 
 
     /* creat pppos */
@@ -748,7 +747,7 @@ int ppp_device_register(struct ppp_device *ppp_device, const char *dev_name, con
     if( result == RT_EOK)
     {
         _g_ppp_device = ppp_device;
-        LOG_I("ppp_device has registered rt_device frame successful.");
+        LOG_I("ppp_device(%s) register successfully.", PPP_DEVICE_NAME);
     }
 
     return result;