diff options
| author | kutayboz <kutayboz@gmail.com> | 2023-06-07 23:47:31 +0300 |
|---|---|---|
| committer | kutayboz <kutayboz@gmail.com> | 2023-06-07 23:47:31 +0300 |
| commit | 703880eb75134fa5c76a376975deb478a69fb06e (patch) | |
| tree | dd36d9f410f96e22cc5509a5d37e55e204e9edce /src/main.c | |
| parent | 79229f93d5bcc4b4e74795577e193808e561d33d (diff) | |
| download | celnetmon-703880eb75134fa5c76a376975deb478a69fb06e.tar.gz | |
Changed the command list to a simplier one
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -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; |
