Skip to content

Commit c53f4d2

Browse files
authored
Merge pull request #12227 from AnttiKauppila/BG96_fix
Cellular: AT + QICSGP set up APN fix
2 parents cbca99d + eb78ba6 commit c53f4d2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularContext.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,21 @@ ControlPlane_netif *QUECTEL_BG96_CellularContext::get_cp_netif()
6969

7070
nsapi_error_t QUECTEL_BG96_CellularContext::do_user_authentication()
7171
{
72+
uint8_t type = (uint8_t)_pdp_type;
73+
if ((uint8_t)_pdp_type < 1) {
74+
type = 1;
75+
}
76+
7277
if (_pwd && _uname) {
73-
if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s%s%s%d", _cid, 1,
78+
if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s%s%s%d", _cid, type,
7479
_apn, _uname, _pwd, _authentication_type) != NSAPI_ERROR_OK) {
7580
return NSAPI_ERROR_AUTH_FAILURE;
7681
}
82+
} else {
83+
if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s", _cid, type,
84+
_apn) != NSAPI_ERROR_OK) {
85+
return NSAPI_ERROR_AUTH_FAILURE;
86+
}
7787
}
7888

7989
return NSAPI_ERROR_OK;

0 commit comments

Comments
 (0)