mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #9378 from oscarh/master
Add get_connection_status() override in CellularContextpull/9615/head
commit
a0ec77d9a8
|
@ -82,6 +82,8 @@ uint32_t AT_CellularContext::get_timeout_for_operation(ContextOperation op) cons
|
|||
return timeout;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool AT_CellularContext::is_connected()
|
||||
{
|
||||
return true;
|
||||
|
@ -197,6 +199,12 @@ nsapi_error_t AT_CellularContext::disconnect()
|
|||
return NSAPI_ERROR_OK;
|
||||
}
|
||||
|
||||
|
||||
nsapi_connection_status_t AT_CellularContext::get_connection_status() const
|
||||
{
|
||||
return NSAPI_STATUS_DISCONNECTED;
|
||||
}
|
||||
|
||||
nsapi_error_t AT_CellularContext::get_apn_backoff_timer(int &backoff_timer)
|
||||
{
|
||||
return NSAPI_ERROR_OK;
|
||||
|
|
|
@ -147,6 +147,11 @@ nsapi_error_t AT_CellularContext::check_operation(nsapi_error_t err, ContextOper
|
|||
return err;
|
||||
}
|
||||
|
||||
nsapi_connection_status_t AT_CellularContext::get_connection_status() const
|
||||
{
|
||||
return _connect_status;
|
||||
}
|
||||
|
||||
uint32_t AT_CellularContext::get_timeout_for_operation(ContextOperation op) const
|
||||
{
|
||||
uint32_t timeout = NETWORK_TIMEOUT; // default timeout is 30 minutes as registration and attach may take time
|
||||
|
|
|
@ -37,6 +37,7 @@ public:
|
|||
virtual void attach(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb);
|
||||
virtual nsapi_error_t connect();
|
||||
virtual nsapi_error_t disconnect();
|
||||
virtual nsapi_connection_status_t get_connection_status() const;
|
||||
virtual bool is_connected();
|
||||
// from CellularBase
|
||||
virtual void set_plmn(const char *plmn);
|
||||
|
|
|
@ -67,7 +67,7 @@ void UBLOX_AT_CellularContext::do_connect()
|
|||
_at.unlock();
|
||||
|
||||
if (_status_cb) {
|
||||
call_network_cb(_connect_status);
|
||||
_status_cb(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, _connect_status);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue