充电桩设计之4G模块 imei
【摘要】
void dx_get_lte_imei(void){ // char cmd[64] = {0}; //char result[512] = {0}; int ret = -1; char *pcTmp = NULL; char *pcOut = g_imei; unsigned char *cm...
-
void dx_get_lte_imei(void)
-
{
-
// char cmd[64] = {0};
-
//char result[512] = {0};
-
int ret = -1;
-
char *pcTmp = NULL;
-
char *pcOut = g_imei;
-
unsigned char *cmd = at_tx_buffer;
-
unsigned char *result = at_rx_buffer;
-
unsigned char result_len = 0;
-
printf("g_imei:%s\n", g_imei);
-
if (dx_check_imei(g_imei))
-
{
-
// snprintf(imei, imei_len, "%s", g_imei);
-
printf("imei haved get ,is %s\r\n",g_imei);
-
return;
-
}
-
memset(at_tx_buffer,0,UART2_TX_BUFFER_LEN);
-
memset((char*)at_rx_buffer,0,UART2_RX_BUFFER_LEN);
-
snprintf((char*)at_tx_buffer,UART2_TX_BUFFER_LEN, "%s",AT_GSN);
-
ret = AT_cmd(cmd, strlen((const char*)cmd), result,&result_len);
-
/*
-
AT+GSN
-
865860040521701
-
-
OK
-
-
*/
-
printf("ret=%d \r\n", ret);
-
printf("strstr(result, OK=0x%08x \r\n", (unsigned int)strstr((const char*)result, "OK
文章来源: blog.csdn.net,作者:悟空胆好小,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/xushx_bigbear/article/details/122871577
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)