diff options
| author | kutayboz <kutayboz@gmail.com> | 2023-06-06 22:54:14 +0300 |
|---|---|---|
| committer | kutayboz <kutayboz@gmail.com> | 2023-06-06 22:54:14 +0300 |
| commit | 29c0a2df3c4b68b1b6fdc9fde12e46df218e8d01 (patch) | |
| tree | 4d6c2b8676bb7a4b335821f97242f66d39092c04 /src | |
| parent | 8ca671f6f056415072d752f9df5637abb4586799 (diff) | |
| download | celnetmon-29c0a2df3c4b68b1b6fdc9fde12e46df218e8d01.tar.gz | |
Added more AT commands to test
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -10,6 +10,8 @@ int main() { char *commandList[] = {"AT", "ATI", "AT+COPS?", "AT+COPS=?"}, + *infoCmdList[] = {"AT+CREG?", "AT+COPS?", "AT+CSQ", "AT+QLTS=1", + "AT+QNWINFO", "AT+QCSQ", "AT+QSPN", "AT+CCLK?"}, serialFilePath[] = "/dev/serial0", *output; int serialPort, moduleStatus; @@ -34,6 +36,7 @@ int main() { return 1; } } + sleep(5); /* Wait for APP RDY*/ } serialPort = openSerialPort(serialFilePath); @@ -53,8 +56,17 @@ int main() { printf("%s\n", output); } - close(serialPort); + for (idx = 0; idx < sizeof(infoCmdList) / sizeof(*infoCmdList); idx++) { + if (0 != querySerialPort(&output, serialPort, infoCmdList[idx])) { + printf("Error querySerialPort()\n"); + close(serialPort); + free(output); + return 1; + } + printf("%s\n", output); + } + close(serialPort); free(output); return 0; } |
