From 29c0a2df3c4b68b1b6fdc9fde12e46df218e8d01 Mon Sep 17 00:00:00 2001 From: kutayboz Date: Tue, 6 Jun 2023 22:54:14 +0300 Subject: Added more AT commands to test --- src/main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index df33ffb..51fed38 100644 --- a/src/main.c +++ b/src/main.c @@ -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; } -- cgit v1.3