Skip to content

Commit be41f52

Browse files
committed
[nrf fromlist] drivers: modem_cellular: fix handling of +C*REG answers
Answers to the `AT+CEREG` read command may contain many parameters depending on how it is configured (with the write command). When it has more than one parameter, the `<stat>` one (which we are interested in) is at the second position. This is the syntax defined by the 3GPP spec for all `+C*REG` commands. Handle all parameter counts properly. Signed-off-by: Tomi Fontanilles <[email protected]> (cherry picked from commit 5876b371032a16af2f12469c7f23fbbb5594d333) Upstream PR #: 80512 Signed-off-by: Tomi Fontanilles <[email protected]>
1 parent 055d020 commit be41f52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/modem/modem_cellular.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ static void modem_cellular_chat_on_cxreg(struct modem_chat *chat, char **argv, u
456456

457457
if (argc == 2) {
458458
registration_status = atoi(argv[1]);
459-
} else if (argc == 3 || argc == 6) {
459+
} else if (argc >= 3) {
460460
registration_status = atoi(argv[2]);
461461
} else {
462462
return;

0 commit comments

Comments
 (0)