summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorkutayboz <kutayboz@gmail.com>2023-06-07 23:47:31 +0300
committerkutayboz <kutayboz@gmail.com>2023-06-07 23:47:31 +0300
commit703880eb75134fa5c76a376975deb478a69fb06e (patch)
treedd36d9f410f96e22cc5509a5d37e55e204e9edce /src/main.c
parent79229f93d5bcc4b4e74795577e193808e561d33d (diff)
downloadcelnetmon-703880eb75134fa5c76a376975deb478a69fb06e.tar.gz
Changed the command list to a simplier one
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;