Skip to content

Commit a2ae34b

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

11 files changed

+44
-44
lines changed

features/cellular/framework/AT/AT_CellularContext.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ using namespace mbed_cellular_util;
4141
using namespace mbed;
4242

4343
AT_CellularContext::AT_CellularContext(ATHandler &at, CellularDevice *device, const char *apn) :
44-
AT_CellularBase(at), _ip_stack_type_requested(DEFAULT_STACK), _is_connected(false), _is_blocking(true),
45-
_current_op(OP_INVALID), _device(device), _nw(0), _fh(0)
44+
AT_CellularBase(at), _ip_stack_type_requested(DEFAULT_STACK), _is_connected(false), _is_blocking(true),
45+
_current_op(OP_INVALID), _device(device), _nw(0), _fh(0)
4646
{
4747
tr_debug("AT_CellularContext::AT_CellularContext(): apn: %s", apn);
4848
_stack = NULL;
@@ -218,7 +218,7 @@ void AT_CellularContext::set_sim_pin(const char *sim_pin)
218218
}
219219

220220
nsapi_error_t AT_CellularContext::connect(const char *sim_pin, const char *apn, const char *uname,
221-
const char *pwd)
221+
const char *pwd)
222222
{
223223
set_sim_pin(sim_pin);
224224
set_credentials(apn, uname, pwd);
@@ -458,7 +458,7 @@ bool AT_CellularContext::set_new_context(int cid)
458458

459459
nsapi_error_t AT_CellularContext::do_activate_context()
460460
{
461-
_at.lock();
461+
_at.lock();
462462

463463
nsapi_error_t err = NSAPI_ERROR_OK;
464464

@@ -536,7 +536,7 @@ void AT_CellularContext::do_connect()
536536
#if !NSAPI_PPP_AVAILABLE
537537
// in PPP mode we did not activate any context, just searched the correct _cid
538538
if (_status_cb) {
539-
_status_cb((nsapi_event_t)CellularActivatePDPContext, (intptr_t )&_cb_data);
539+
_status_cb((nsapi_event_t)CellularActivatePDPContext, (intptr_t)&_cb_data);
540540
}
541541
#endif // !NSAPI_PPP_AVAILABLE
542542
}
@@ -810,7 +810,7 @@ nsapi_error_t AT_CellularContext::get_pdpcontext_params(pdpContextList_t &params
810810
void AT_CellularContext::cellular_callback(nsapi_event_t ev, intptr_t ptr)
811811
{
812812
if (ev >= NSAPI_EVENT_CELLULAR_STATUS_BASE && ev <= NSAPI_EVENT_CELLULAR_STATUS_END) {
813-
cell_callback_data_t* data = (cell_callback_data_t*)ptr;
813+
cell_callback_data_t *data = (cell_callback_data_t *)ptr;
814814
cellular_connection_status_t st = (cellular_connection_status_t)ev;
815815
_cb_data.error = data->error;
816816
tr_debug("AT_CellularContext::cellular_callback, network_callback called with event: %d, err: %d, data: %d", ev, data->error, data->status_data);
@@ -853,16 +853,16 @@ void AT_CellularContext::cellular_callback(nsapi_event_t ev, intptr_t ptr)
853853
_semaphore.release();
854854
} else {
855855
if ((st == CellularDeviceReady && _current_op == OP_DEVICE_READY) ||
856-
(st == CellularSIMStatusChanged && _current_op == OP_SIM_READY &&
857-
data->status_data == CellularSIM::SimStateReady)) {
856+
(st == CellularSIMStatusChanged && _current_op == OP_SIM_READY &&
857+
data->status_data == CellularSIM::SimStateReady)) {
858858
// target reached, release semaphore
859859
_semaphore.release();
860860
} else if (st == CellularRegistrationStatusChanged && (data->status_data == CellularNetwork::RegisteredHomeNetwork ||
861-
data->status_data == CellularNetwork::RegisteredRoaming || data->status_data == CellularNetwork::AlreadyRegistered) && _current_op == OP_REGISTER) {
861+
data->status_data == CellularNetwork::RegisteredRoaming || data->status_data == CellularNetwork::AlreadyRegistered) && _current_op == OP_REGISTER) {
862862
// target reached, release semaphore
863863
_semaphore.release();
864864
} else if (st == CellularAttachNetwork && (_current_op == OP_ATTACH || _current_op == OP_CONNECT) &&
865-
data->status_data == CellularNetwork::Attached) {
865+
data->status_data == CellularNetwork::Attached) {
866866
// target reached, release semaphore
867867
_semaphore.release();
868868
}

features/cellular/framework/AT/AT_CellularDevice.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ using namespace mbed;
3434
#define DEFAULT_AT_TIMEOUT 1000 // at default timeout in milliseconds
3535

3636
AT_CellularDevice::AT_CellularDevice(FileHandle *fh) : CellularDevice(fh), _atHandlers(0), _network(0), _sms(0),
37-
_sim(0), _power(0), _information(0), _context_list(0), _default_timeout(DEFAULT_AT_TIMEOUT),
38-
_modem_debug_on(false)
37+
_sim(0), _power(0), _information(0), _context_list(0), _default_timeout(DEFAULT_AT_TIMEOUT),
38+
_modem_debug_on(false)
3939
{
4040
}
4141

4242
AT_CellularDevice::~AT_CellularDevice()
4343
{
44-
delete _state_machine;
44+
delete _state_machine;
4545

4646
// make sure that all is deleted even if somewhere close was not called and reference counting is messed up.
4747
_network_ref_count = 1;
@@ -56,10 +56,10 @@ AT_CellularDevice::~AT_CellularDevice()
5656
close_sim();
5757
close_information();
5858

59-
AT_CellularContext* curr = _context_list;
60-
AT_CellularContext* next;
59+
AT_CellularContext *curr = _context_list;
60+
AT_CellularContext *next;
6161
while (curr) {
62-
next = (AT_CellularContext*)curr->_next;
62+
next = (AT_CellularContext *)curr->_next;
6363
delete curr;
6464
curr = next;
6565
}
@@ -134,17 +134,17 @@ CellularContext *AT_CellularDevice::create_context(FileHandle *fh, const char *a
134134
ATHandler *atHandler = get_at_handler(fh);
135135
if (atHandler) {
136136
AT_CellularContext *ctx = create_context_impl(*atHandler, apn);
137-
AT_CellularContext* curr = _context_list;
137+
AT_CellularContext *curr = _context_list;
138138

139139
if (_context_list == NULL) {
140140
_context_list = ctx;
141141
return ctx;
142142
}
143143

144-
AT_CellularContext* prev;
144+
AT_CellularContext *prev;
145145
while (curr) {
146146
prev = curr;
147-
curr = (AT_CellularContext*)curr->_next;
147+
curr = (AT_CellularContext *)curr->_next;
148148
}
149149

150150
prev->_next = ctx;
@@ -160,20 +160,20 @@ AT_CellularContext *AT_CellularDevice::create_context_impl(ATHandler &at, const
160160

161161
void AT_CellularDevice::delete_context(CellularContext *context)
162162
{
163-
AT_CellularContext* curr = _context_list;
164-
AT_CellularContext* prev = NULL;
163+
AT_CellularContext *curr = _context_list;
164+
AT_CellularContext *prev = NULL;
165165
while (curr) {
166166
if (curr == context) {
167167
if (prev == NULL) {
168-
_context_list = (AT_CellularContext*)curr->_next;
168+
_context_list = (AT_CellularContext *)curr->_next;
169169
} else {
170170
prev->_next = curr->_next;
171171
}
172172
}
173173
prev = curr;
174-
curr = (AT_CellularContext*)curr->_next;
174+
curr = (AT_CellularContext *)curr->_next;
175175
}
176-
delete (AT_CellularContext*)context;
176+
delete (AT_CellularContext *)context;
177177
}
178178

179179
CellularNetwork *AT_CellularDevice::open_network(FileHandle *fh)

features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace mbed {
2222

2323
GEMALTO_CINTERION_CellularContext::GEMALTO_CINTERION_CellularContext(ATHandler &at, CellularDevice *device,
24-
const char *apn) : AT_CellularContext(at, device, apn)
24+
const char *apn) : AT_CellularContext(at, device, apn)
2525
{
2626
}
2727

features/cellular/framework/targets/MultiTech/DragonflyNano/PPP/SARA4_PPP_CellularContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
namespace mbed {
2020

2121
SARA4_PPP_CellularContext::SARA4_PPP_CellularContext(ATHandler &at, CellularDevice *device, const char *apn) :
22-
AT_CellularContext(at, device, apn)
22+
AT_CellularContext(at, device, apn)
2323
{
2424
}
2525

features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95_CellularContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace mbed {
2121

2222
QUECTEL_BC95_CellularContext::QUECTEL_BC95_CellularContext(ATHandler &at, CellularDevice *device, const char *apn) :
23-
AT_CellularContext(at, device, apn)
23+
AT_CellularContext(at, device, apn)
2424
{
2525
}
2626

features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace mbed {
2121

2222
QUECTEL_BG96_CellularContext::QUECTEL_BG96_CellularContext(ATHandler &at, CellularDevice *device, const char *apn) :
23-
AT_CellularContext(at, device, apn)
23+
AT_CellularContext(at, device, apn)
2424
{
2525
}
2626

features/cellular/framework/targets/QUECTEL/UG96/QUECTEL_UG96_CellularContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
namespace mbed {
2020

2121
QUECTEL_UG96_CellularContext::QUECTEL_UG96_CellularContext(ATHandler &at, CellularDevice *device, const char *apn) :
22-
AT_CellularContext(at, device, apn)
22+
AT_CellularContext(at, device, apn)
2323
{
2424
}
2525

features/cellular/framework/targets/TELIT/HE910/TELIT_HE910_CellularContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
namespace mbed {
2020

2121
TELIT_HE910_CellularContext::TELIT_HE910_CellularContext(ATHandler &at, CellularDevice *device, const char *apn) :
22-
AT_CellularContext(at, device, apn)
22+
AT_CellularContext(at, device, apn)
2323
{
2424
}
2525

features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace mbed {
2222

2323
UBLOX_AT_CellularContext::UBLOX_AT_CellularContext(ATHandler &at, CellularDevice *device, const char *apn) :
24-
AT_CellularContext(at, device, apn)
24+
AT_CellularContext(at, device, apn)
2525
{
2626
// The authentication to use
2727
_auth = NSAPI_SECURITY_UNKNOWN;
@@ -75,9 +75,9 @@ nsapi_error_t UBLOX_AT_CellularContext::open_data_channel()
7575
{
7676
bool success = false;
7777
int active = 0;
78-
char * config = NULL;
78+
char *config = NULL;
7979
nsapi_error_t err = NSAPI_ERROR_NO_CONNECTION;
80-
char imsi[MAX_IMSI_LENGTH+1];
80+
char imsi[MAX_IMSI_LENGTH + 1];
8181

8282
// do check for stack to validate that we have support for stack
8383
_stack = get_stack();
@@ -98,14 +98,14 @@ nsapi_error_t UBLOX_AT_CellularContext::open_data_channel()
9898
if (_apn == NULL) {
9999
err = get_imsi(imsi);
100100
if (err == NSAPI_ERROR_OK) {
101-
config = (char*)apnconfig(imsi);
101+
config = (char *)apnconfig(imsi);
102102
}
103103
}
104104

105105
// Attempt to connect
106106
do {
107107
get_next_credentials(&config);
108-
if(_uname && _pwd) {
108+
if (_uname && _pwd) {
109109
_auth = (*_uname && *_pwd) ? _auth : NSAPI_SECURITY_NONE;
110110
} else {
111111
_auth = NSAPI_SECURITY_NONE;
@@ -122,9 +122,9 @@ nsapi_error_t UBLOX_AT_CellularContext::open_data_channel()
122122
return err;
123123
}
124124

125-
bool UBLOX_AT_CellularContext::activate_profile(const char* apn,
126-
const char* username,
127-
const char* password)
125+
bool UBLOX_AT_CellularContext::activate_profile(const char *apn,
126+
const char *username,
127+
const char *password)
128128
{
129129
bool activated = false;
130130
bool success = false;
@@ -253,7 +253,7 @@ bool UBLOX_AT_CellularContext::disconnect_modem_stack()
253253
return success;
254254
}
255255

256-
nsapi_error_t UBLOX_AT_CellularContext::get_imsi(char* imsi)
256+
nsapi_error_t UBLOX_AT_CellularContext::get_imsi(char *imsi)
257257
{
258258
_at.lock();
259259
_at.cmd_start("AT+CIMI");
@@ -269,7 +269,7 @@ nsapi_error_t UBLOX_AT_CellularContext::get_imsi(char* imsi)
269269
}
270270

271271
// Get the next set of credentials, based on IMSI.
272-
void UBLOX_AT_CellularContext::get_next_credentials(char ** config)
272+
void UBLOX_AT_CellularContext::get_next_credentials(char **config)
273273
{
274274
if (*config) {
275275
_apn = _APN_GET(*config);

features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class UBLOX_AT_CellularContext: public AT_CellularContext {
5959
* NSAPI_SECURITY_CHAP or NSAPI_SECURITY_UNKNOWN).
6060
* @return True if successful, otherwise false.
6161
*/
62-
bool activate_profile(const char* apn, const char* username, const char* password);
62+
bool activate_profile(const char *apn, const char *username, const char *password);
6363

6464
/** Convert nsapi_security_t to the modem security numbers.
6565
*
@@ -76,11 +76,11 @@ class UBLOX_AT_CellularContext: public AT_CellularContext {
7676

7777
/** Read IMSI of modem.
7878
*/
79-
nsapi_error_t get_imsi(char* imsi);
79+
nsapi_error_t get_imsi(char *imsi);
8080

8181
/** Get the next set of credentials from the database.
8282
*/
83-
void get_next_credentials(char ** config);
83+
void get_next_credentials(char **config);
8484
};
8585

8686
} /* namespace mbed */

features/cellular/framework/targets/UBLOX/PPP/UBLOX_PPP_CellularContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
namespace mbed {
2020

2121
UBLOX_PPP_CellularContext::UBLOX_PPP_CellularContext(ATHandler &at, CellularDevice *device, const char *apn) :
22-
AT_CellularContext(at, device, apn)
22+
AT_CellularContext(at, device, apn)
2323
{
2424
}
2525

0 commit comments

Comments
 (0)