mirror of https://github.com/ARMmbed/mbed-os.git
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 callpull/12227/head
parent
dc6320239b
commit
2fb167be26
|
@ -69,11 +69,20 @@ ControlPlane_netif *QUECTEL_BG96_CellularContext::get_cp_netif()
|
|||
|
||||
nsapi_error_t QUECTEL_BG96_CellularContext::do_user_authentication()
|
||||
{
|
||||
uint8_t type = 1;
|
||||
if ((uint8_t)_pdp_type > 1) {
|
||||
type = 2;
|
||||
}
|
||||
if (_pwd && _uname) {
|
||||
if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s%s%s%d", _cid, 1,
|
||||
if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s%s%s%d", _cid, type,
|
||||
_apn, _uname, _pwd, _authentication_type) != NSAPI_ERROR_OK) {
|
||||
return NSAPI_ERROR_AUTH_FAILURE;
|
||||
}
|
||||
} else {
|
||||
if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s", _cid, type,
|
||||
_apn) != NSAPI_ERROR_OK) {
|
||||
return NSAPI_ERROR_AUTH_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return NSAPI_ERROR_OK;
|
||||
|
|
Loading…
Reference in New Issue