Skip to content

Commit 4698cd2

Browse files
author
Ari Parkkila
committed
Cellular: Implement APN authentication for BG96
1 parent fb899d2 commit 4698cd2

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,24 @@ nsapi_error_t QUECTEL_BG96_CellularNetwork::set_access_technology_impl(RadioAcce
111111

112112
return _at.unlock_return_error();
113113
}
114+
115+
nsapi_error_t QUECTEL_BG96_CellularNetwork::do_user_authentication()
116+
{
117+
if (_pwd && _uname) {
118+
_at.cmd_start("AT+QICSGP=");
119+
_at.write_int(_cid);
120+
_at.write_int(1); // IPv4
121+
_at.write_string(_apn);
122+
_at.write_string(_uname);
123+
_at.write_string(_pwd);
124+
_at.write_int(_authentication_type);
125+
_at.cmd_stop();
126+
_at.resp_start();
127+
_at.resp_stop();
128+
if (_at.get_last_error() != NSAPI_ERROR_OK) {
129+
return NSAPI_ERROR_AUTH_FAILURE;
130+
}
131+
}
132+
133+
return NSAPI_ERROR_OK;
134+
}

features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularNetwork.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class QUECTEL_BG96_CellularNetwork : public AT_CellularNetwork {
3333
virtual nsapi_error_t set_access_technology_impl(RadioAccessTechnology opRat);
3434

3535
virtual bool get_modem_stack_type(nsapi_ip_stack_t requested_stack);
36+
37+
virtual nsapi_error_t do_user_authentication();
3638
};
3739

3840
} // namespace mbed

0 commit comments

Comments
 (0)