@@ -51,7 +51,7 @@ static rtos::Semaphore network_semaphore(0);
51
51
static CellularConnectionFSM cellular;
52
52
static CellularConnectionFSM::CellularState cellular_target_state;
53
53
static CELLULAR_DEVICE *device;
54
- static CellularNetwork* nw;
54
+ static CellularNetwork * nw;
55
55
56
56
57
57
static bool fsm_callback (int state, int next_state)
@@ -73,7 +73,7 @@ static void test_network_interface_fsm()
73
73
device = new CELLULAR_DEVICE (queue);
74
74
TEST_ASSERT (device != NULL );
75
75
76
- CellularNetwork* nw = device->open_network (&cellular_serial);
76
+ CellularNetwork * nw = device->open_network (&cellular_serial);
77
77
TEST_ASSERT (nw != NULL );
78
78
TEST_ASSERT (nw->init () == NSAPI_ERROR_OK);
79
79
@@ -99,7 +99,7 @@ static void init_network_interface()
99
99
100
100
101
101
static bool get_network_registration (CellularNetwork::RegistrationType type,
102
- CellularNetwork::RegistrationStatus &status, bool &is_registered)
102
+ CellularNetwork::RegistrationStatus &status, bool &is_registered)
103
103
{
104
104
is_registered = false ;
105
105
nsapi_error_t err = nw->get_registration_status (type, status);
@@ -147,7 +147,7 @@ static void nw_callback(nsapi_event_t ev, intptr_t intptr)
147
147
148
148
static void test_network_registration ()
149
149
{
150
- cellular.get_device ()->set_timeout (10 * 1000 );
150
+ cellular.get_device ()->set_timeout (10 * 1000 );
151
151
nw = cellular.get_network ();
152
152
TEST_ASSERT (nw != NULL );
153
153
@@ -224,8 +224,8 @@ static void test_other()
224
224
TEST_ASSERT (err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR);
225
225
#if CELLULAR_DEVICE != QUECTEL_BG96 // QUECTEL_BG96 does not give any specific reason for device error
226
226
if (err == NSAPI_ERROR_DEVICE_ERROR) {
227
- TEST_ASSERT (((AT_CellularNetwork*)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
228
- ((AT_CellularNetwork*)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
227
+ TEST_ASSERT (((AT_CellularNetwork *)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
228
+ ((AT_CellularNetwork *)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
229
229
}
230
230
#endif
231
231
@@ -234,8 +234,8 @@ static void test_other()
234
234
TEST_ASSERT (err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR);
235
235
if (err == NSAPI_ERROR_DEVICE_ERROR) {
236
236
#if CELLULAR_DEVICE != QUECTEL_BG96 // QUECTEL_BG96 does not give any specific reason for device error
237
- TEST_ASSERT (((AT_CellularNetwork*)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
238
- ((AT_CellularNetwork*)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
237
+ TEST_ASSERT (((AT_CellularNetwork *)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
238
+ ((AT_CellularNetwork *)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
239
239
#endif
240
240
} else {
241
241
TEST_ASSERT (uplinkRate >= 0 );
@@ -245,10 +245,10 @@ static void test_other()
245
245
TEST_ASSERT (err == NSAPI_ERROR_OK || err == NSAPI_ERROR_UNSUPPORTED);
246
246
247
247
// scanning of operators might take a long time
248
- cellular.get_device ()->set_timeout (240 * 1000 );
248
+ cellular.get_device ()->set_timeout (240 * 1000 );
249
249
CellularNetwork::operList_t operators;
250
250
TEST_ASSERT (nw->scan_plmn (operators, uplinkRate) == NSAPI_ERROR_OK);
251
- cellular.get_device ()->set_timeout (10 * 1000 );
251
+ cellular.get_device ()->set_timeout (10 * 1000 );
252
252
253
253
254
254
// all current targets support IPV4
@@ -262,12 +262,12 @@ static void test_other()
262
262
TEST_ASSERT (err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR);
263
263
if (err == NSAPI_ERROR_DEVICE_ERROR) {
264
264
#if CELLULAR_DEVICE != TELIT_HE910 // TELIT_HE910 just gives an error and no specific error number so we can't know is this real error or that modem/network does not support the command
265
- TEST_ASSERT (((AT_CellularNetwork*)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
266
- ((AT_CellularNetwork*)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
265
+ TEST_ASSERT (((AT_CellularNetwork *)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
266
+ ((AT_CellularNetwork *)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
267
267
#endif
268
268
} else {
269
269
// should have some values, only not optional are apn and bearer id
270
- CellularNetwork::pdpcontext_params_t * params = params_list.get_head ();
270
+ CellularNetwork::pdpcontext_params_t * params = params_list.get_head ();
271
271
TEST_ASSERT (strlen (params->apn ) > 0 );
272
272
TEST_ASSERT (params->bearer_id >= 0 )
273
273
}
@@ -277,8 +277,8 @@ static void test_other()
277
277
TEST_ASSERT (err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR);
278
278
if (err == NSAPI_ERROR_DEVICE_ERROR) {
279
279
#if CELLULAR_DEVICE != QUECTEL_BG96 // QUECTEL_BG96 does not give any specific reason for device error
280
- TEST_ASSERT (((AT_CellularNetwork*)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
281
- ((AT_CellularNetwork*)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
280
+ TEST_ASSERT (((AT_CellularNetwork *)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
281
+ ((AT_CellularNetwork *)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
282
282
#endif
283
283
} else {
284
284
// we should have some values which are not optional
@@ -290,8 +290,8 @@ static void test_other()
290
290
err = nw->get_signal_quality (rssi, ber);
291
291
TEST_ASSERT (err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR);
292
292
if (err == NSAPI_ERROR_DEVICE_ERROR) {
293
- TEST_ASSERT (((AT_CellularNetwork*)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
294
- ((AT_CellularNetwork*)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
293
+ TEST_ASSERT (((AT_CellularNetwork *)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
294
+ ((AT_CellularNetwork *)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
295
295
} else {
296
296
// test for values
297
297
TEST_ASSERT (rssi >= 0 );
@@ -319,10 +319,10 @@ static void test_other()
319
319
TEST_ASSERT (err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR);
320
320
if (err == NSAPI_ERROR_DEVICE_ERROR) {
321
321
// if device error then we must check was that really device error or that modem/network does not support the commands
322
- TEST_ASSERT (((AT_CellularNetwork*)nw)->get_device_error ().errCode == 4 // 4 == NOT SUPPORTED BY THE MODEM
323
- && ((AT_CellularNetwork*)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
322
+ TEST_ASSERT (((AT_CellularNetwork *)nw)->get_device_error ().errCode == 4 // 4 == NOT SUPPORTED BY THE MODEM
323
+ && ((AT_CellularNetwork *)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
324
324
} else {
325
- CellularNetwork::operator_names_t * opn = op_names.get_head ();
325
+ CellularNetwork::operator_names_t * opn = op_names.get_head ();
326
326
TEST_ASSERT (strlen (opn->numeric ) > 0 );
327
327
TEST_ASSERT (strlen (opn->alpha > 0 ));
328
328
}
@@ -336,8 +336,8 @@ static void test_other()
336
336
TEST_ASSERT (err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR);
337
337
if (err == NSAPI_ERROR_DEVICE_ERROR) {
338
338
// if device error then we must check was that really device error or that modem/network does not support the commands
339
- TEST_ASSERT (((AT_CellularNetwork*)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
340
- ((AT_CellularNetwork*)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
339
+ TEST_ASSERT (((AT_CellularNetwork *)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
340
+ ((AT_CellularNetwork *)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
341
341
} else {
342
342
TEST_ASSERT (supported_opt != SUPPORTED_UE_OPT_MAX);
343
343
TEST_ASSERT (preferred_opt != PREFERRED_UE_OPT_MAX);
@@ -347,8 +347,8 @@ static void test_other()
347
347
TEST_ASSERT (err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR);
348
348
if (err == NSAPI_ERROR_DEVICE_ERROR) {
349
349
// if device error then we must check was that really device error or that modem/network does not support the commands
350
- TEST_ASSERT (((AT_CellularNetwork*)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
351
- ((AT_CellularNetwork*)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
350
+ TEST_ASSERT (((AT_CellularNetwork *)nw)->get_device_error ().errCode == 100 && // 100 == unknown command for modem
351
+ ((AT_CellularNetwork *)nw)->get_device_error ().errType == 3 ); // 3 == CME error from the modem
352
352
}
353
353
#endif
354
354
@@ -364,8 +364,8 @@ static void test_disconnect()
364
364
static void test_detach ()
365
365
{
366
366
// in PPP mode there is NO CARRIER waiting so flush it out
367
- rtos::Thread::wait (6 * 1000 );
368
- ((AT_CellularNetwork*)nw)->get_at_handler ().flush ();
367
+ rtos::Thread::wait (6 * 1000 );
368
+ ((AT_CellularNetwork *)nw)->get_at_handler ().flush ();
369
369
370
370
nsapi_connection_status_t st = nw->get_connection_status ();
371
371
TEST_ASSERT (st == NSAPI_STATUS_DISCONNECTED);
@@ -399,7 +399,7 @@ static Case cases[] = {
399
399
400
400
static utest::v1::status_t test_setup (const size_t number_of_cases)
401
401
{
402
- GREENTEA_SETUP (10 * 60 , " default_auto" );
402
+ GREENTEA_SETUP (10 * 60 , " default_auto" );
403
403
return verbose_test_setup_handler (number_of_cases);
404
404
}
405
405
0 commit comments