Skip to content

Commit 2fb167b

Browse files
author
Antti Kauppila
committed
Fixed IOTCELL-2384
Earlier we called AT+QICSGP only if the username and password was set. It seems that we must call it also to set up APN while in AT mode. This commit fixes the issue + updated IPv4/v6 handling to be correct in the same call
1 parent dc63202 commit 2fb167b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

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

7070
nsapi_error_t QUECTEL_BG96_CellularContext::do_user_authentication()
7171
{
72+
uint8_t type = 1;
73+
if ((uint8_t)_pdp_type > 1) {
74+
type = 2;
75+
}
7276
if (_pwd && _uname) {
73-
if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s%s%s%d", _cid, 1,
77+
if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s%s%s%d", _cid, type,
7478
_apn, _uname, _pwd, _authentication_type) != NSAPI_ERROR_OK) {
7579
return NSAPI_ERROR_AUTH_FAILURE;
7680
}
81+
} else {
82+
if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s", _cid, type,
83+
_apn) != NSAPI_ERROR_OK) {
84+
return NSAPI_ERROR_AUTH_FAILURE;
85+
}
7786
}
7887

7988
return NSAPI_ERROR_OK;

0 commit comments

Comments
 (0)