@@ -406,7 +406,7 @@ static int handle_security_args(int argc, char *argv[], mlme_security_t *key)
406
406
}
407
407
}
408
408
if (cmd_parameter_val (argc, argv, " --key_source" , &str)) {
409
- if (strlen (str) == 2 * 8 + 7 ) {
409
+ if (strlen (str) == 2 * 8 + 7 ) {
410
410
if (string_to_bytes (str, key->Keysource , 8 ) != 0 ) {
411
411
return CMDLINE_RETCODE_INVALID_PARAMETERS;
412
412
}
@@ -425,9 +425,9 @@ static void add_beacon(const uint8_t *beacon, uint8_t len)
425
425
}
426
426
unsigned int cur_beacon = received_beacons.count ;
427
427
received_beacons.beacon_lengths [cur_beacon] = len;
428
- received_beacons.beacons [cur_beacon] = (char *)ns_dyn_mem_temporary_alloc (len <= 75 ? 75 : len);
428
+ received_beacons.beacons [cur_beacon] = (char *)ns_dyn_mem_temporary_alloc (len <= 75 ? 75 : len);
429
429
if (len != 0 ) {
430
- std::memcpy (received_beacons.beacons [cur_beacon], beacon, len);
430
+ std::memcpy (received_beacons.beacons [cur_beacon], beacon, len);
431
431
}
432
432
++received_beacons.count ;
433
433
}
@@ -503,7 +503,7 @@ void mac_data_indication_handler(const mac_api_t *api, const mcps_data_ind_t *da
503
503
if (data->msduLength != expected_statuses.data_ind_len ) {
504
504
return ;
505
505
}
506
- if (strncmp ((const char *)data->msdu_ptr , (const char *)expected_statuses.data_ind , expected_statuses.data_ind_len ) == 0 ) {
506
+ if (strncmp ((const char *)data->msdu_ptr , (const char *)expected_statuses.data_ind , expected_statuses.data_ind_len ) == 0 ) {
507
507
++data_count;
508
508
} else {
509
509
tr_warn (" Received unexpected data!" );
@@ -535,13 +535,13 @@ void mac_mlme_confirm_handler(const mac_api_t *api, mlme_primitive id, const voi
535
535
break ;
536
536
}
537
537
case MLME_GET: {
538
- mlme_get_conf_t *get_data = (mlme_get_conf_t *)data;
538
+ mlme_get_conf_t *get_data = (mlme_get_conf_t *)data;
539
539
cmd_printf (" MLME-GET.confirm\n " );
540
540
if (!silent_mode) {
541
541
cmd_printf (" status: %hhu (%s)\n " , get_data->status , mlme_status_string (get_data->status ));
542
542
cmd_printf (" attr: %hhu\n " , get_data->attr );
543
543
cmd_printf (" attr_index: %hhu\n " , get_data->attr_index );
544
- cmd_printf (" value_pointer: %s\n " , trace_array ((uint8_t *)get_data->value_pointer , get_data->value_size ));
544
+ cmd_printf (" value_pointer: %s\n " , trace_array ((uint8_t *)get_data->value_pointer , get_data->value_size ));
545
545
cmd_printf (" value_size: %hhu\n " , get_data->value_size );
546
546
}
547
547
if (get_data->status == expected_statuses.get_conf ) {
@@ -561,7 +561,7 @@ void mac_mlme_confirm_handler(const mac_api_t *api, mlme_primitive id, const voi
561
561
break ;
562
562
}
563
563
case MLME_SCAN: {
564
- mlme_scan_conf_t *scan_data = (mlme_scan_conf_t *)data;
564
+ mlme_scan_conf_t *scan_data = (mlme_scan_conf_t *)data;
565
565
cmd_printf (" MLME-SCAN.confirm\n " );
566
566
if (!silent_mode) {
567
567
cmd_printf (" status: %hhu (%s)\n " , scan_data->status , mlme_status_string (scan_data->status ));
@@ -596,7 +596,7 @@ void mac_mlme_confirm_handler(const mac_api_t *api, mlme_primitive id, const voi
596
596
break ;
597
597
}
598
598
case MLME_POLL: {
599
- mlme_poll_conf_t *poll_data = (mlme_poll_conf_t *)data;
599
+ mlme_poll_conf_t *poll_data = (mlme_poll_conf_t *)data;
600
600
cmd_printf (" MLME-POLL.confirm\n " );
601
601
if (!silent_mode) {
602
602
cmd_printf (" status: %hhu (%s)\n " , poll_data->status , mlme_status_string (poll_data->status ));
@@ -632,15 +632,15 @@ void mac_mlme_indication_handler(const mac_api_t *api, mlme_primitive id, const
632
632
break ;
633
633
}
634
634
case MLME_BEACON_NOTIFY: {
635
- const mlme_beacon_ind_t *beacon_ind = (mlme_beacon_ind_t *)data;
635
+ const mlme_beacon_ind_t *beacon_ind = (mlme_beacon_ind_t *)data;
636
636
cmd_printf (" MLME-BEACON-NOTIFY.indication\n " );
637
637
if (!silent_mode) {
638
638
cmd_printf (" BSN: %hhu\n " , beacon_ind->BSN );
639
639
print_PAN_descriptor (&beacon_ind->PANDescriptor );
640
640
cmd_printf (" PendAddrSpec.short_address_count %u\n " , beacon_ind->PendAddrSpec .short_address_count );
641
641
cmd_printf (" PendAddrSpec.extended_address_count %u\n " , beacon_ind->PendAddrSpec .extended_address_count );
642
642
cmd_printf (" AddrList %s\n " , trace_array (beacon_ind->AddrList , beacon_ind->PendAddrSpec .short_address_count * 2 +
643
- beacon_ind->PendAddrSpec .extended_address_count * 8 ));
643
+ beacon_ind->PendAddrSpec .extended_address_count * 8 ));
644
644
cmd_printf (" beacon_data_length %hu\n " , beacon_ind->beacon_data_length );
645
645
cmd_printf (" beacon_data %s\n " , trace_array (beacon_ind->beacon_data , beacon_ind->beacon_data_length ));
646
646
}
@@ -655,7 +655,7 @@ void mac_mlme_indication_handler(const mac_api_t *api, mlme_primitive id, const
655
655
}
656
656
case MLME_COMM_STATUS: {
657
657
cmd_printf (" MLME-COMM-STATUS.indication\n " );
658
- const mlme_comm_status_t *comm_status_ind_data = (mlme_comm_status_t *)data;
658
+ const mlme_comm_status_t *comm_status_ind_data = (mlme_comm_status_t *)data;
659
659
if (!silent_mode) {
660
660
cmd_printf (" PANId: 0x%04X\n " , comm_status_ind_data->PANId );
661
661
cmd_printf (" SrcAddrMode: %u\n " , comm_status_ind_data->SrcAddrMode );
@@ -822,7 +822,7 @@ int mac_data_command(int argc, char *argv[])
822
822
if (strlen (str) != data_req.msduLength ) {
823
823
return CMDLINE_RETCODE_INVALID_PARAMETERS;
824
824
}
825
- data_req.msdu = (uint8_t *)ns_dyn_mem_temporary_alloc (data_req.msduLength );
825
+ data_req.msdu = (uint8_t *)ns_dyn_mem_temporary_alloc (data_req.msduLength );
826
826
if (data_req.msdu == NULL ) {
827
827
tr_error (" Failed to allocate memory for the msdu" );
828
828
return CMDLINE_RETCODE_FAIL;
@@ -879,7 +879,7 @@ int mac_poll_command(int argc, char *argv[])
879
879
}
880
880
}
881
881
if (cmd_parameter_val (argc, argv, " --coord_address" , &str)) {
882
- int len = (poll_req.CoordAddrMode == 2 ? 2 : 8 );
882
+ int len = (poll_req.CoordAddrMode == 2 ? 2 : 8 );
883
883
if (string_to_bytes (str, poll_req.CoordAddress , len) != 0 ) {
884
884
return CMDLINE_RETCODE_INVALID_PARAMETERS;
885
885
}
@@ -915,7 +915,7 @@ int mac_set_command(int argc, char *argv[])
915
915
uint16_t val_uint16 = 0 ;
916
916
uint32_t val_uint32 = 0 ;
917
917
uint8_t *val_ptr_array = NULL ;
918
-
918
+
919
919
cmd_printf (" MLME-SET.request\n " );
920
920
if (cmd_parameter_val (argc, argv, " --attr" , &str)) {
921
921
uint32_t attribute = strtoul (str, NULL , 16 );
@@ -933,7 +933,7 @@ int mac_set_command(int argc, char *argv[])
933
933
}
934
934
}
935
935
if (cmd_parameter_val (argc, argv, " --value_ascii" , &str)) {
936
- val_ptr_array = (uint8_t *)ns_dyn_mem_temporary_alloc (strlen (str));
936
+ val_ptr_array = (uint8_t *)ns_dyn_mem_temporary_alloc (strlen (str));
937
937
if (val_ptr_array == NULL ) {
938
938
tr_error (" Failed to allocate memory for MLME-SET.request" );
939
939
return CMDLINE_RETCODE_FAIL;
@@ -942,7 +942,7 @@ int mac_set_command(int argc, char *argv[])
942
942
set_req.value_pointer = val_ptr_array;
943
943
} else if (cmd_parameter_val (argc, argv, " --value_bytes" , &str)) {
944
944
size_t bytes = (strlen (str) + 1 ) / 3 ;
945
- val_ptr_array = (uint8_t *)ns_dyn_mem_temporary_alloc (bytes);
945
+ val_ptr_array = (uint8_t *)ns_dyn_mem_temporary_alloc (bytes);
946
946
if (val_ptr_array == NULL ) {
947
947
tr_error (" Failed to allocate memory for MLME-SET.request" );
948
948
return CMDLINE_RETCODE_FAIL;
@@ -1074,7 +1074,7 @@ static int key_config_command(int argc, char *argv[])
1074
1074
int lookup_index = 0 , device_index = 0 , usage_index = 0 ;
1075
1075
1076
1076
if (cmd_parameter_val (argc, argv, " --key" , &str)) {
1077
- if (strlen (str) == 2 * 16 + 15 ) {
1077
+ if (strlen (str) == 2 * 16 + 15 ) {
1078
1078
if (string_to_bytes (str, key_descriptor.Key , 16 ) != 0 ) {
1079
1079
return CMDLINE_RETCODE_INVALID_PARAMETERS;
1080
1080
}
@@ -1111,7 +1111,7 @@ static int key_config_command(int argc, char *argv[])
1111
1111
}
1112
1112
}
1113
1113
if (cmd_parameter_val (argc, argv, " --lookup_data" , &str)) {
1114
- if (strlen (str) == 2 * 9 + 8 ) {
1114
+ if (strlen (str) == 2 * 9 + 8 ) {
1115
1115
if (string_to_bytes (str, key_descriptor.KeyIdLookupList [lookup_index].LookupData , 9 ) != 0 ) {
1116
1116
return CMDLINE_RETCODE_INVALID_PARAMETERS;
1117
1117
}
@@ -1226,7 +1226,7 @@ int mac_add_neighbour_command(int argc, char *argv[])
1226
1226
}
1227
1227
}
1228
1228
if (cmd_parameter_val (argc, argv, " --mac64" , &str)) {
1229
- if (strlen (str) == 2 * 8 + 7 ) {
1229
+ if (strlen (str) == 2 * 8 + 7 ) {
1230
1230
if (string_to_bytes (str, neighbour.ExtAddress , 8 ) != 0 ) {
1231
1231
return CMDLINE_RETCODE_INVALID_PARAMETERS;
1232
1232
}
@@ -1270,7 +1270,7 @@ static int filter_start(int argc, char *argv[])
1270
1270
} else if (strcmp (str, " fixed" ) == 0 ) {
1271
1271
int32_t lqi, dbm;
1272
1272
if (cmd_parameter_int (argc, argv, " --lqi_m" , &lqi) &&
1273
- cmd_parameter_int (argc, argv, " --dbm_m" , &dbm)) {
1273
+ cmd_parameter_int (argc, argv, " --dbm_m" , &dbm)) {
1274
1274
return mac_filter_start (mac_interface->parent_id , MAC_FILTER_FIXED (lqi, dbm)) < 0 ? CMDLINE_RETCODE_FAIL : CMDLINE_RETCODE_SUCCESS;
1275
1275
}
1276
1276
}
@@ -1286,9 +1286,9 @@ static int filter_add(int argc, char *argv[])
1286
1286
int32_t lqi_m, lqi_add, dbm_m, dbm_add;
1287
1287
1288
1288
if (cmd_parameter_int (argc, argv, " --lqi_m" , &lqi_m) &&
1289
- cmd_parameter_int (argc, argv, " --lqi_add" , &lqi_add) &&
1290
- cmd_parameter_int (argc, argv, " --dbm_m" , &dbm_m) &&
1291
- cmd_parameter_int (argc, argv, " --dbm_add" , &dbm_add)) {
1289
+ cmd_parameter_int (argc, argv, " --lqi_add" , &lqi_add) &&
1290
+ cmd_parameter_int (argc, argv, " --dbm_m" , &dbm_m) &&
1291
+ cmd_parameter_int (argc, argv, " --dbm_add" , &dbm_add)) {
1292
1292
} else if (cmd_parameter_val (argc, argv, " --mode" , &str)) {
1293
1293
if (strcmp (str, " allow" )) {
1294
1294
lqi_m = dbm_m = 256 ;
@@ -1298,7 +1298,7 @@ static int filter_add(int argc, char *argv[])
1298
1298
} else if (strcmp (str, " fixed" )) {
1299
1299
lqi_add = dbm_add = 0 ;
1300
1300
if (cmd_parameter_int (argc, argv, " --lqi_m" , &lqi_m) &&
1301
- cmd_parameter_int (argc, argv, " --dbm_m" , &dbm_m)) {
1301
+ cmd_parameter_int (argc, argv, " --dbm_m" , &dbm_m)) {
1302
1302
} else {
1303
1303
return CMDLINE_RETCODE_INVALID_PARAMETERS;
1304
1304
}
@@ -1424,7 +1424,7 @@ int mac_config_status_command(int argc, char *argv[])
1424
1424
} else if (cmd_parameter_val (argc, argv, " --data_ind" , &str)) {
1425
1425
size_t len = strlen (str);
1426
1426
ns_dyn_mem_free (expected_statuses.data_ind );
1427
- expected_statuses.data_ind = (uint8_t *)ns_dyn_mem_temporary_alloc (len);
1427
+ expected_statuses.data_ind = (uint8_t *)ns_dyn_mem_temporary_alloc (len);
1428
1428
expected_statuses.data_ind_len = len;
1429
1429
std::memcpy (expected_statuses.data_ind , str, len);
1430
1430
} else if (cmd_parameter_int (argc, argv, " --get" , &val)) {
@@ -1541,7 +1541,7 @@ int mac_analyze_ed_command(int argc, char *argv[])
1541
1541
return CMDLINE_RETCODE_INVALID_PARAMETERS;
1542
1542
}
1543
1543
} else {
1544
- return CMDLINE_RETCODE_INVALID_PARAMETERS;
1544
+ return CMDLINE_RETCODE_INVALID_PARAMETERS;
1545
1545
}
1546
1546
1547
1547
if (cmd_parameter_int (argc, argv, " --above" , &val)) {
0 commit comments