Skip to content

Commit 58b176c

Browse files
committed
Add connection status override for CellularContext
Add override for the virtual method get_connection_status() inherited from NetworkInterface. The method in the base class returns NSAPI_STATUS_ERROR_UNSUPPORTED. The CellularContext has the member _connection_status, which means that we could return this.
1 parent 41ecde9 commit 58b176c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

features/cellular/framework/AT/AT_CellularContext.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ nsapi_error_t AT_CellularContext::check_operation(nsapi_error_t err, ContextOper
147147
return err;
148148
}
149149

150+
nsapi_connection_status_t AT_CellularContext::get_connection_status() const
151+
{
152+
return _connect_status;
153+
}
154+
150155
uint32_t AT_CellularContext::get_timeout_for_operation(ContextOperation op) const
151156
{
152157
uint32_t timeout = NETWORK_TIMEOUT; // default timeout is 30 minutes as registration and attach may take time

features/cellular/framework/AT/AT_CellularContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class AT_CellularContext : public CellularContext, public AT_CellularBase {
3737
virtual void attach(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb);
3838
virtual nsapi_error_t connect();
3939
virtual nsapi_error_t disconnect();
40+
virtual nsapi_connection_status_t get_connection_status() const;
4041
virtual bool is_connected();
4142
// from CellularBase
4243
virtual void set_plmn(const char *plmn);

0 commit comments

Comments
 (0)