Skip to content

Commit f91eed9

Browse files
committed
cellular: fix onboard cellular coding style
1 parent a2ae34b commit f91eed9

File tree

1 file changed

+53
-16
lines changed

1 file changed

+53
-16
lines changed

features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.h

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,69 @@
2020
#ifdef CELLULAR_DEVICE
2121
using namespace mbed;
2222
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use CellularBase::get_default_instance() instead.")
23-
class OnboardCellularInterface : public CellularBase
24-
{
23+
class OnboardCellularInterface : public CellularBase {
2524
public:
26-
OnboardCellularInterface() {
25+
OnboardCellularInterface()
26+
{
2727
context = CellularContext::get_default_instance();
2828
MBED_ASSERT(context != NULL);
2929
}
3030
public: // from NetworkInterface
31-
virtual nsapi_error_t set_blocking(bool blocking) {return context->set_blocking(blocking);}
32-
virtual NetworkStack *get_stack() {return context->get_stack();}
33-
virtual const char *get_ip_address() {return context->get_ip_address();}
34-
virtual void attach(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb) {context->attach(status_cb);}
35-
virtual nsapi_error_t connect() {return context->connect();}
36-
virtual nsapi_error_t disconnect() {return context->disconnect();}
31+
virtual nsapi_error_t set_blocking(bool blocking)
32+
{
33+
return context->set_blocking(blocking);
34+
}
35+
virtual NetworkStack *get_stack()
36+
{
37+
return context->get_stack();
38+
}
39+
virtual const char *get_ip_address()
40+
{
41+
return context->get_ip_address();
42+
}
43+
virtual void attach(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb)
44+
{
45+
context->attach(status_cb);
46+
}
47+
virtual nsapi_error_t connect()
48+
{
49+
return context->connect();
50+
}
51+
virtual nsapi_error_t disconnect()
52+
{
53+
return context->disconnect();
54+
}
3755

3856
// from CellularBase
39-
virtual void set_plmn(const char *plmn) {context->set_plmn(plmn);}
40-
virtual void set_sim_pin(const char *sim_pin) {context->set_sim_pin(sim_pin);}
57+
virtual void set_plmn(const char *plmn)
58+
{
59+
context->set_plmn(plmn);
60+
}
61+
virtual void set_sim_pin(const char *sim_pin)
62+
{
63+
context->set_sim_pin(sim_pin);
64+
}
4165
virtual nsapi_error_t connect(const char *sim_pin, const char *apn = 0, const char *uname = 0,
4266
const char *pwd = 0)
43-
{return context->connect(sim_pin, apn, uname, pwd);}
67+
{
68+
return context->connect(sim_pin, apn, uname, pwd);
69+
}
4470
virtual void set_credentials(const char *apn, const char *uname = 0, const char *pwd = 0)
45-
{context->set_credentials(apn, uname, pwd);}
46-
virtual const char *get_netmask() {return context->get_netmask();}
47-
virtual const char *get_gateway() {return context->get_gateway();}
48-
virtual bool is_connected() {return context->is_connected();}
71+
{
72+
context->set_credentials(apn, uname, pwd);
73+
}
74+
virtual const char *get_netmask()
75+
{
76+
return context->get_netmask();
77+
}
78+
virtual const char *get_gateway()
79+
{
80+
return context->get_gateway();
81+
}
82+
virtual bool is_connected()
83+
{
84+
return context->is_connected();
85+
}
4986

5087
private:
5188
CellularContext *context;

0 commit comments

Comments
 (0)