summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorkutayboz <kutayboz@gmail.com>2023-06-06 22:54:14 +0300
committerkutayboz <kutayboz@gmail.com>2023-06-06 22:54:14 +0300
commit29c0a2df3c4b68b1b6fdc9fde12e46df218e8d01 (patch)
tree4d6c2b8676bb7a4b335821f97242f66d39092c04 /src/main.c
parent8ca671f6f056415072d752f9df5637abb4586799 (diff)
downloadcelnetmon-29c0a2df3c4b68b1b6fdc9fde12e46df218e8d01.tar.gz
Added more AT commands to test
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 13 insertions, 1 deletions
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;
}