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.
2 parents a3d8c8f + 91333d2 commit 53adeedCopy full SHA for 53adeed
features/cellular/framework/AT/AT_CellularNetwork.cpp
@@ -556,10 +556,18 @@ nsapi_error_t AT_CellularNetwork::set_registration(const char *plmn)
556
557
if (!plmn) {
558
tr_debug("Automatic network registration");
559
- _at.cmd_start("AT+COPS=0");
+ _at.cmd_start("AT+COPS?");
560
_at.cmd_stop();
561
- _at.resp_start();
+ _at.resp_start("AT+COPS:");
562
+ int mode = _at.read_int();
563
_at.resp_stop();
564
+ if (mode != 0) {
565
+ _at.clear_error();
566
+ _at.cmd_start("AT+COPS=0");
567
+ _at.cmd_stop();
568
+ _at.resp_start();
569
+ _at.resp_stop();
570
+ }
571
} else {
572
tr_debug("Manual network registration to %s", plmn);
573
_at.cmd_start("AT+COPS=4,2,");
0 commit comments