From f0f00760cd194bdf1368caeeb2fe5a81462055ae Mon Sep 17 00:00:00 2001 From: chenyong <1521761801@qq.com> Date: Thu, 12 Sep 2019 14:24:24 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91IEMI=20->?= =?UTF-8?q?=20IMEI=20=E7=9B=B8=E5=85=B3=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenyong <1521761801@qq.com> --- class/ec20/at_device_ec20.c | 26 +++++++++++++------------- class/ec20/at_socket_ec20.c | 2 +- class/m26/at_device_m26.c | 26 +++++++++++++------------- class/sim76xx/at_device_sim76xx.c | 26 +++++++++++++------------- class/sim800c/at_device_sim800c.c | 26 +++++++++++++------------- 5 files changed, 53 insertions(+), 53 deletions(-) diff --git a/class/ec20/at_device_ec20.c b/class/ec20/at_device_ec20.c index 44044c3..e566f4e 100644 --- a/class/ec20/at_device_ec20.c +++ b/class/ec20/at_device_ec20.c @@ -224,7 +224,7 @@ static void ec20_power_off(struct at_device *device) /* set ec20 network interface device status and address information */ static int ec20_netdev_set_info(struct netdev *netdev) { -#define EC20_IEMI_RESP_SIZE 32 +#define EC20_IMEI_RESP_SIZE 32 #define EC20_IPADDR_RESP_SIZE 64 #define EC20_DNS_RESP_SIZE 96 #define EC20_INFO_RESP_TIMO rt_tick_from_millisecond(300) @@ -248,7 +248,7 @@ static int ec20_netdev_set_info(struct netdev *netdev) netdev_low_level_set_link_status(netdev, RT_TRUE); netdev_low_level_set_dhcp_status(netdev, RT_TRUE); - resp = at_create_resp(EC20_IEMI_RESP_SIZE, 0, EC20_INFO_RESP_TIMO); + resp = at_create_resp(EC20_IMEI_RESP_SIZE, 0, EC20_INFO_RESP_TIMO); if (resp == RT_NULL) { LOG_E("no memory for resp create."); @@ -256,41 +256,41 @@ static int ec20_netdev_set_info(struct netdev *netdev) goto __exit; } - /* set network interface device hardware address(IEMI) */ + /* set network interface device hardware address(IMEI) */ { #define EC20_NETDEV_HWADDR_LEN 8 - #define EC20_IEMI_LEN 15 + #define EC20_IMEI_LEN 15 - char iemi[EC20_IEMI_LEN] = {0}; + char imei[EC20_IMEI_LEN] = {0}; int i = 0, j = 0; - /* send "AT+GSN" commond to get device IEMI */ + /* send "AT+GSN" commond to get device IMEI */ if (at_obj_exec_cmd(device->client, resp, "AT+GSN") < 0) { result = -RT_ERROR; goto __exit; } - if (at_resp_parse_line_args(resp, 2, "%s", iemi) <= 0) + if (at_resp_parse_line_args(resp, 2, "%s", imei) <= 0) { LOG_E("%s device prase \"AT+GSN\" cmd error.", device->name); result = -RT_ERROR; goto __exit; } - LOG_D("%s device IEMI number: %s", device->name, iemi); + LOG_D("%s device IMEI number: %s", device->name, imei); netdev->hwaddr_len = EC20_NETDEV_HWADDR_LEN; - /* get hardware address by IEMI */ - for (i = 0, j = 0; i < EC20_NETDEV_HWADDR_LEN && j < EC20_IEMI_LEN; i++, j+=2) + /* get hardware address by IMEI */ + for (i = 0, j = 0; i < EC20_NETDEV_HWADDR_LEN && j < EC20_IMEI_LEN; i++, j+=2) { - if (j != EC20_IEMI_LEN - 1) + if (j != EC20_IMEI_LEN - 1) { - netdev->hwaddr[i] = (iemi[j] - '0') * 10 + (iemi[j + 1] - '0'); + netdev->hwaddr[i] = (imei[j] - '0') * 10 + (imei[j + 1] - '0'); } else { - netdev->hwaddr[i] = (iemi[j] - '0'); + netdev->hwaddr[i] = (imei[j] - '0'); } } } diff --git a/class/ec20/at_socket_ec20.c b/class/ec20/at_socket_ec20.c index 83ef66c..8ecca83 100644 --- a/class/ec20/at_socket_ec20.c +++ b/class/ec20/at_socket_ec20.c @@ -408,7 +408,7 @@ __retry: /* waiting result event from AT URC, the device default connection timeout is 75 seconds, but it set to 10 seconds is convenient to use.*/ if (ec20_socket_event_recv(device, SET_EVENT(device_socket, 0), 10 * RT_TICK_PER_SECOND, RT_EVENT_FLAG_OR) < 0) { - LOG_E("%s device socket(%d) wait connect URC timeout.", device->name, device_socket); + LOG_E("%s device socket(%d) wait connect result timeout.", device->name, device_socket); result = -RT_ETIMEOUT; goto __exit; } diff --git a/class/m26/at_device_m26.c b/class/m26/at_device_m26.c index 052f54d..6a4cf45 100644 --- a/class/m26/at_device_m26.c +++ b/class/m26/at_device_m26.c @@ -92,7 +92,7 @@ static void m26_power_off(struct at_device *device) /* set m26 network interface device status and address information */ static int m26_netdev_set_info(struct netdev *netdev) { -#define M26_IEMI_RESP_SIZE 32 +#define M26_IMEI_RESP_SIZE 32 #define M26_IPADDR_RESP_SIZE 32 #define M26_DNS_RESP_SIZE 96 #define M26_INFO_RESP_TIMO rt_tick_from_millisecond(300) @@ -117,7 +117,7 @@ static int m26_netdev_set_info(struct netdev *netdev) netdev_low_level_set_status(netdev, RT_TRUE); netdev_low_level_set_dhcp_status(netdev, RT_TRUE); - resp = at_create_resp(M26_IEMI_RESP_SIZE, 0, M26_INFO_RESP_TIMO); + resp = at_create_resp(M26_IMEI_RESP_SIZE, 0, M26_INFO_RESP_TIMO); if (resp == RT_NULL) { LOG_E("no memory for resp create."); @@ -125,41 +125,41 @@ static int m26_netdev_set_info(struct netdev *netdev) goto __exit; } - /* set network interface device hardware address(IEMI) */ + /* set network interface device hardware address(IMEI) */ { #define M26_NETDEV_HWADDR_LEN 8 - #define M26_IEMI_LEN 15 + #define M26_IMEI_LEN 15 - char iemi[M26_IEMI_LEN] = {0}; + char imei[M26_IMEI_LEN] = {0}; int i = 0, j = 0; - /* send "AT+GSN" commond to get device IEMI */ + /* send "AT+GSN" commond to get device IMEI */ if (at_obj_exec_cmd(client, resp, "AT+GSN") < 0) { result = -RT_ERROR; goto __exit; } - if (at_resp_parse_line_args(resp, 2, "%s", iemi) <= 0) + if (at_resp_parse_line_args(resp, 2, "%s", imei) <= 0) { LOG_E("%s device prase \"AT+GSN\" cmd error.", device->name); result = -RT_ERROR; goto __exit; } - LOG_D("%s device IEMI number: %s", device->name, iemi); + LOG_D("%s device IMEI number: %s", device->name, imei); netdev->hwaddr_len = M26_NETDEV_HWADDR_LEN; - /* get hardware address by IEMI */ - for (i = 0, j = 0; i < M26_NETDEV_HWADDR_LEN && j < M26_IEMI_LEN; i++, j+=2) + /* get hardware address by IMEI */ + for (i = 0, j = 0; i < M26_NETDEV_HWADDR_LEN && j < M26_IMEI_LEN; i++, j+=2) { - if (j != M26_IEMI_LEN - 1) + if (j != M26_IMEI_LEN - 1) { - netdev->hwaddr[i] = (iemi[j] - '0') * 10 + (iemi[j + 1] - '0'); + netdev->hwaddr[i] = (imei[j] - '0') * 10 + (imei[j + 1] - '0'); } else { - netdev->hwaddr[i] = (iemi[j] - '0'); + netdev->hwaddr[i] = (imei[j] - '0'); } } } diff --git a/class/sim76xx/at_device_sim76xx.c b/class/sim76xx/at_device_sim76xx.c index 775ba53..547d1ea 100644 --- a/class/sim76xx/at_device_sim76xx.c +++ b/class/sim76xx/at_device_sim76xx.c @@ -97,7 +97,7 @@ static void sim76xx_power_off(struct at_device *device) /* set sim76xx network interface device status and address information */ static int sim76xx_netdev_set_info(struct netdev *netdev) { -#define SIM76XX_IEMI_RESP_SIZE 256 +#define SIM76XX_IMEI_RESP_SIZE 256 #define SIM76XX_IPADDR_RESP_SIZE 64 #define SIM76XX_DNS_RESP_SIZE 96 #define SIM76XX_INFO_RESP_TIMO rt_tick_from_millisecond(300) @@ -121,7 +121,7 @@ static int sim76xx_netdev_set_info(struct netdev *netdev) netdev_low_level_set_link_status(netdev, RT_TRUE); netdev_low_level_set_dhcp_status(netdev, RT_TRUE); - resp = at_create_resp(SIM76XX_IEMI_RESP_SIZE, 0, SIM76XX_INFO_RESP_TIMO); + resp = at_create_resp(SIM76XX_IMEI_RESP_SIZE, 0, SIM76XX_INFO_RESP_TIMO); if (resp == RT_NULL) { LOG_E("no memory for resp create."); @@ -129,41 +129,41 @@ static int sim76xx_netdev_set_info(struct netdev *netdev) goto __exit; } - /* set network interface device hardware address(IEMI) */ + /* set network interface device hardware address(IMEI) */ { #define SIM76XX_NETDEV_HWADDR_LEN 8 - #define SIM76XX_IEMI_LEN 15 + #define SIM76XX_IMEI_LEN 15 - char iemi[SIM76XX_IEMI_LEN] = {0}; + char imei[SIM76XX_IMEI_LEN] = {0}; int i = 0, j = 0; - /* send "ATI" commond to get device IEMI */ + /* send "ATI" commond to get device IMEI */ if (at_obj_exec_cmd(device->client, resp, "ATI") < 0) { result = -RT_ERROR; goto __exit; } - if (at_resp_parse_line_args_by_kw(resp, "IMEI:", "IMEI: %s", iemi) <= 0) + if (at_resp_parse_line_args_by_kw(resp, "IMEI:", "IMEI: %s", imei) <= 0) { LOG_E("%s device prase \"ATI\" cmd error.", device->name); result = -RT_ERROR; goto __exit; } - LOG_D("%s device IEMI number: %s", device->name, iemi); + LOG_D("%s device IMEI number: %s", device->name, imei); netdev->hwaddr_len = SIM76XX_NETDEV_HWADDR_LEN; - /* get hardware address by IEMI */ - for (i = 0, j = 0; i < SIM76XX_NETDEV_HWADDR_LEN && j < SIM76XX_IEMI_LEN; i++, j += 2) + /* get hardware address by IMEI */ + for (i = 0, j = 0; i < SIM76XX_NETDEV_HWADDR_LEN && j < SIM76XX_IMEI_LEN; i++, j += 2) { - if (j != SIM76XX_IEMI_LEN - 1) + if (j != SIM76XX_IMEI_LEN - 1) { - netdev->hwaddr[i] = (iemi[j] - '0') * 10 + (iemi[j + 1] - '0'); + netdev->hwaddr[i] = (imei[j] - '0') * 10 + (imei[j + 1] - '0'); } else { - netdev->hwaddr[i] = (iemi[j] - '0'); + netdev->hwaddr[i] = (imei[j] - '0'); } } } diff --git a/class/sim800c/at_device_sim800c.c b/class/sim800c/at_device_sim800c.c index cebdd2b..d03a11f 100644 --- a/class/sim800c/at_device_sim800c.c +++ b/class/sim800c/at_device_sim800c.c @@ -98,7 +98,7 @@ static void sim800c_power_off(struct at_device *device) /* set sim800c network interface device status and address information */ static int sim800c_netdev_set_info(struct netdev *netdev) { -#define SIM800C_IEMI_RESP_SIZE 32 +#define SIM800C_IMEI_RESP_SIZE 32 #define SIM800C_IPADDR_RESP_SIZE 32 #define SIM800C_DNS_RESP_SIZE 96 #define SIM800C_INFO_RESP_TIMO rt_tick_from_millisecond(300) @@ -122,7 +122,7 @@ static int sim800c_netdev_set_info(struct netdev *netdev) netdev_low_level_set_link_status(netdev, RT_TRUE); netdev_low_level_set_dhcp_status(netdev, RT_TRUE); - resp = at_create_resp(SIM800C_IEMI_RESP_SIZE, 0, SIM800C_INFO_RESP_TIMO); + resp = at_create_resp(SIM800C_IMEI_RESP_SIZE, 0, SIM800C_INFO_RESP_TIMO); if (resp == RT_NULL) { LOG_E("no memory for resp create."); @@ -130,41 +130,41 @@ static int sim800c_netdev_set_info(struct netdev *netdev) goto __exit; } - /* set network interface device hardware address(IEMI) */ + /* set network interface device hardware address(IMEI) */ { #define SIM800C_NETDEV_HWADDR_LEN 8 - #define SIM800C_IEMI_LEN 15 + #define SIM800C_IMEI_LEN 15 - char iemi[SIM800C_IEMI_LEN] = {0}; + char imei[SIM800C_IMEI_LEN] = {0}; int i = 0, j = 0; - /* send "AT+GSN" commond to get device IEMI */ + /* send "AT+GSN" commond to get device IMEI */ if (at_obj_exec_cmd(device->client, resp, "AT+GSN") < 0) { result = -RT_ERROR; goto __exit; } - if (at_resp_parse_line_args(resp, 2, "%s", iemi) <= 0) + if (at_resp_parse_line_args(resp, 2, "%s", imei) <= 0) { LOG_E("%s device prase \"AT+GSN\" cmd error.", device->name); result = -RT_ERROR; goto __exit; } - LOG_D("%s device IEMI number: %s", device->name, iemi); + LOG_D("%s device IMEI number: %s", device->name, imei); netdev->hwaddr_len = SIM800C_NETDEV_HWADDR_LEN; - /* get hardware address by IEMI */ - for (i = 0, j = 0; i < SIM800C_NETDEV_HWADDR_LEN && j < SIM800C_IEMI_LEN; i++, j += 2) + /* get hardware address by IMEI */ + for (i = 0, j = 0; i < SIM800C_NETDEV_HWADDR_LEN && j < SIM800C_IMEI_LEN; i++, j += 2) { - if (j != SIM800C_IEMI_LEN - 1) + if (j != SIM800C_IMEI_LEN - 1) { - netdev->hwaddr[i] = (iemi[j] - '0') * 10 + (iemi[j + 1] - '0'); + netdev->hwaddr[i] = (imei[j] - '0') * 10 + (imei[j + 1] - '0'); } else { - netdev->hwaddr[i] = (iemi[j] - '0'); + netdev->hwaddr[i] = (imei[j] - '0'); } } }