summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/main.c b/src/main.c
index 51fed38..6ebfcd2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -9,9 +9,18 @@
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?"},
+ char *commandList[] = {"AT",
+ "ATI",
+ "AT+QCFG=\"nwscanmode\"",
+ "AT+QCFG=\"iotopmode\"",
+ "AT+COPS?",
+ "AT+CREG?",
+ "AT+CSQ",
+ "AT+QLTS=1",
+ "AT+QNWINFO",
+ "AT+QCSQ",
+ "AT+QSPN",
+ "AT+CCLK?"},
serialFilePath[] = "/dev/serial0", *output;
int serialPort, moduleStatus;
@@ -56,16 +65,6 @@ int main() {
printf("%s\n", output);
}
- 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;