Skip to content

Commit 91333d2

Browse files
author
Mudassar Hussain
committed
Removed strncmp
1 parent 3bee060 commit 91333d2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

features/cellular/framework/AT/AT_CellularNetwork.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,14 +546,12 @@ nsapi_error_t AT_CellularNetwork::set_registration(const char *plmn)
546546

547547
if (!plmn) {
548548
tr_debug("Automatic network registration");
549-
uint8_t len=8;
550-
uint8_t buf[8];
551549
_at.cmd_start("AT+COPS?");
552550
_at.cmd_stop();
553-
_at.resp_start();
554-
_at.read_bytes(buf,len);
551+
_at.resp_start("AT+COPS:");
552+
int mode = _at.read_int();
555553
_at.resp_stop();
556-
if (strncmp((char*)buf,"+COPS: 0",len) != 0) {
554+
if (mode != 0) {
557555
_at.clear_error();
558556
_at.cmd_start("AT+COPS=0");
559557
_at.cmd_stop();

0 commit comments

Comments
 (0)