Merge pull request #12227 from AnttiKauppila/BG96_fix

Cellular: AT + QICSGP set up APN fix
pull/12245/head
Martin Kojtal 2020-01-15 12:59:09 +01:00 committed by GitHub
commit c53f4d2344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -69,11 +69,21 @@ ControlPlane_netif *QUECTEL_BG96_CellularContext::get_cp_netif()
nsapi_error_t QUECTEL_BG96_CellularContext::do_user_authentication() nsapi_error_t QUECTEL_BG96_CellularContext::do_user_authentication()
{ {
uint8_t type = (uint8_t)_pdp_type;
if ((uint8_t)_pdp_type < 1) {
type = 1;
}
if (_pwd && _uname) { 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) { _apn, _uname, _pwd, _authentication_type) != NSAPI_ERROR_OK) {
return NSAPI_ERROR_AUTH_FAILURE; 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; return NSAPI_ERROR_OK;