summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}