充电桩设计之4G模块获取信号强度与质量
【摘要】
int dx_get_lte_signalQuality(void)
{
// char cmd[64] = {0};
//char result[512] = {0};
int ret = -1;
char *pcTmp = NULL;
char sigal[32] = {0};
cha...
int dx_get_lte_signalQuality(void)
{
// char cmd[64] = {0};
//char result[512] = {0};
int ret = -1;
char *pcTmp = NULL;
char sigal[32] = {0};
char *pcSigal = sigal;
int rssi = 0;
int index = 0;
unsigned char *cmd = at_tx_buffer;
unsigned char *result = at_rx_buffer;
unsigned char result_len = 0;
// snprintf(cmd, sizeof(cmd), "AT+CSQ");
memset(at_tx_buffer,0,UART2_TX_BUFFER_LEN);
memset(at_rx_buffer,0,UART2_RX_BUFFER_LEN);
snprintf((char*)at_tx_buffer,UART2_TX_BUFFER_LEN, AT_CSQ);
ret = AT_cmd(cmd, strlen((const char*)cmd), result, &result_len);
/*
AT+CSQ
+CSQ: 19,99
OK
*/
// printf("AT+CSQ:\n%s\n", result);
printf("\n result =%s\n", result);
if (ret || !strlen((const char*)result) || !strstr((const char*)result, "OK"))
{
ret = 0;
goto out
文章来源: blog.csdn.net,作者:悟空胆好小,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/xushx_bigbear/article/details/122871610
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)