mirror of https://github.com/ARMmbed/mbed-os.git
Cellular: Change visibility of _is_connected as protected
AT_CellularContext::do_connect() is a virtual API and therefore can be overwritten in inherited class. The problem was that it sets AT_CellularContext::_is_connected flag but earlier it was set as private member making it impossible to set in overwritten do_connect() method. This commit fixes the problem by changing _is_connected as protected enabling its use in inherited class.pull/11630/head
parent
eeb033f814
commit
1279c20ce6
|
@ -47,7 +47,7 @@ using namespace mbed;
|
||||||
using namespace rtos;
|
using namespace rtos;
|
||||||
|
|
||||||
AT_CellularContext::AT_CellularContext(ATHandler &at, CellularDevice *device, const char *apn, bool cp_req, bool nonip_req) :
|
AT_CellularContext::AT_CellularContext(ATHandler &at, CellularDevice *device, const char *apn, bool cp_req, bool nonip_req) :
|
||||||
AT_CellularBase(at), _is_connected(false), _current_op(OP_INVALID), _fh(0), _cp_req(cp_req)
|
AT_CellularBase(at), _current_op(OP_INVALID), _fh(0), _cp_req(cp_req), _is_connected(false)
|
||||||
{
|
{
|
||||||
tr_info("New CellularContext %s (%p)", apn ? apn : "", this);
|
tr_info("New CellularContext %s (%p)", apn ? apn : "", this);
|
||||||
_nonip_req = nonip_req;
|
_nonip_req = nonip_req;
|
||||||
|
|
|
@ -121,7 +121,6 @@ private:
|
||||||
void do_disconnect();
|
void do_disconnect();
|
||||||
void set_cid(int cid);
|
void set_cid(int cid);
|
||||||
private:
|
private:
|
||||||
bool _is_connected;
|
|
||||||
ContextOperation _current_op;
|
ContextOperation _current_op;
|
||||||
FileHandle *_fh;
|
FileHandle *_fh;
|
||||||
rtos::Semaphore _semaphore;
|
rtos::Semaphore _semaphore;
|
||||||
|
@ -131,6 +130,7 @@ protected:
|
||||||
char _found_apn[MAX_APN_LENGTH];
|
char _found_apn[MAX_APN_LENGTH];
|
||||||
// flag indicating if CP was requested to be setup
|
// flag indicating if CP was requested to be setup
|
||||||
bool _cp_req;
|
bool _cp_req;
|
||||||
|
bool _is_connected;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace mbed
|
} // namespace mbed
|
||||||
|
|
Loading…
Reference in New Issue