diff --git a/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp b/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp index 9878e2eb21..1bbe3da29f 100644 --- a/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp +++ b/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp @@ -38,7 +38,7 @@ NetworkStack *GEMALTO_CINTERION_CellularContext::get_stack() } if (!_stack) { - _stack = new GEMALTO_CINTERION_CellularStack(_at, _apn, _cid, (nsapi_ip_stack_t)_pdp_type); + _stack = new GEMALTO_CINTERION_CellularStack(_at, _apn, _uname, _pwd, _cid, (nsapi_ip_stack_t)_pdp_type); } return _stack; } diff --git a/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp b/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp index 24b466ad1a..09046105b2 100644 --- a/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp +++ b/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp @@ -32,8 +32,9 @@ using namespace mbed; -GEMALTO_CINTERION_CellularStack::GEMALTO_CINTERION_CellularStack(ATHandler &atHandler, const char *apn, - int cid, nsapi_ip_stack_t stack_type) : AT_CellularStack(atHandler, cid, stack_type), _apn(apn) +GEMALTO_CINTERION_CellularStack::GEMALTO_CINTERION_CellularStack(ATHandler &atHandler, const char *apn, const char *user, const char* password, + int cid, nsapi_ip_stack_t stack_type) : AT_CellularStack(atHandler, cid, stack_type), _apn(apn), + _user(user), _password(password) { } @@ -551,6 +552,22 @@ nsapi_error_t GEMALTO_CINTERION_CellularStack::create_connection_profile(int con _at.cmd_stop_read_resp(); } + if (_user && strlen(_user) > 0) { + _at.cmd_start("AT^SICS="); + _at.write_int(connection_profile_id); + _at.write_string("user"); + _at.write_string(_user); + _at.cmd_stop_read_resp(); + } + + if (_password && strlen(_password) > 0) { + _at.cmd_start("AT^SICS="); + _at.write_int(connection_profile_id); + _at.write_string("passwd"); + _at.write_string(_password); + _at.cmd_stop_read_resp(); + } + // set maximum inactivity timeout _at.cmd_start("AT^SICS="); _at.write_int(connection_profile_id); diff --git a/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.h b/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.h index 9d4e156e14..225a1019b7 100644 --- a/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.h +++ b/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.h @@ -24,7 +24,7 @@ namespace mbed { class GEMALTO_CINTERION_CellularStack : public AT_CellularStack { public: - GEMALTO_CINTERION_CellularStack(ATHandler &atHandler, const char *apn, int cid, nsapi_ip_stack_t stack_type); + GEMALTO_CINTERION_CellularStack(ATHandler &atHandler, const char *apn, const char *username, const char* password, int cid, nsapi_ip_stack_t stack_type); virtual ~GEMALTO_CINTERION_CellularStack(); protected: @@ -62,8 +62,10 @@ private: // socket open need to be deferred until sendto due to BGS2 does not support UDP server endpoint nsapi_error_t socket_open_defer(CellularSocket *socket, const SocketAddress *address = NULL); - // connection profile configuration needs Access Point Name + // connection profile configuration needs Access Point Name, User Name and Password const char *_apn; + const char *_user; + const char *_password; }; } // namespace mbed