Skip to content

Commit a8cde30

Browse files
Mudassar Hussainadbridge
authored andcommitted
Removed strncmp
1 parent 6d4e280 commit a8cde30

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
@@ -556,14 +556,12 @@ nsapi_error_t AT_CellularNetwork::set_registration(const char *plmn)
556556

557557
if (!plmn) {
558558
tr_debug("Automatic network registration");
559-
uint8_t len=8;
560-
uint8_t buf[8];
561559
_at.cmd_start("AT+COPS?");
562560
_at.cmd_stop();
563-
_at.resp_start();
564-
_at.read_bytes(buf,len);
561+
_at.resp_start("AT+COPS:");
562+
int mode = _at.read_int();
565563
_at.resp_stop();
566-
if (strncmp((char*)buf,"+COPS: 0",len) != 0) {
564+
if (mode != 0) {
567565
_at.clear_error();
568566
_at.cmd_start("AT+COPS=0");
569567
_at.cmd_stop();

0 commit comments

Comments
 (0)