We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3bee060 commit 91333d2Copy full SHA for 91333d2
features/cellular/framework/AT/AT_CellularNetwork.cpp
@@ -546,14 +546,12 @@ nsapi_error_t AT_CellularNetwork::set_registration(const char *plmn)
546
547
if (!plmn) {
548
tr_debug("Automatic network registration");
549
- uint8_t len=8;
550
- uint8_t buf[8];
551
_at.cmd_start("AT+COPS?");
552
_at.cmd_stop();
553
- _at.resp_start();
554
- _at.read_bytes(buf,len);
+ _at.resp_start("AT+COPS:");
+ int mode = _at.read_int();
555
_at.resp_stop();
556
- if (strncmp((char*)buf,"+COPS: 0",len) != 0) {
+ if (mode != 0) {
557
_at.clear_error();
558
_at.cmd_start("AT+COPS=0");
559
0 commit comments