@@ -79,7 +79,7 @@ fhss_structure_t *fhss_enable(fhss_api_t *fhss_api, const fhss_configuration_t *
79
79
fhss_struct -> bs -> fhss_configuration .fhss_max_synch_interval = 240 ;
80
80
}
81
81
ns_list_init (& fhss_struct -> fhss_failed_tx_list );
82
- fhss_struct -> bs -> own_hop = 0xff ;
82
+ fhss_struct -> own_hop = 0xff ;
83
83
fhss_reset (fhss_struct );
84
84
85
85
if (fhss_beacon_create_tasklet (fhss_struct ) < 0 ) {
@@ -93,7 +93,7 @@ fhss_structure_t *fhss_enable(fhss_api_t *fhss_api, const fhss_configuration_t *
93
93
94
94
bool fhss_is_synch_root (fhss_structure_t * fhss_structure )
95
95
{
96
- if (fhss_structure -> bs -> own_hop > 0 ) {
96
+ if (fhss_structure -> own_hop > 0 ) {
97
97
return false;
98
98
}
99
99
return true;
@@ -241,7 +241,7 @@ static int fhss_update_txrx_slots(fhss_structure_t *fhss_structure)
241
241
*
242
242
*/
243
243
244
- if ((fhss_structure -> bs -> own_hop % 2 )) {
244
+ if ((fhss_structure -> own_hop % 2 )) {
245
245
tx_slot_up_limit += tx_slot_length ;
246
246
}
247
247
while (number_of_tx_slots -- )
@@ -367,12 +367,12 @@ static int fhss_sync_with_beacon(fhss_structure_t *fhss_structure,
367
367
configuration -> fhss_number_of_superframes = payload -> number_of_superframes_per_channel ;
368
368
// todo:
369
369
// * payload->time_since_last_beacon
370
- uint8_t own_hop_tmp = fhss_structure -> bs -> own_hop ;
370
+ uint8_t own_hop_tmp = fhss_structure -> own_hop ;
371
371
if (fhss_is_synch_root (fhss_structure ) == false) {
372
372
// my own hop count is one more than the parent's
373
- fhss_structure -> bs -> own_hop = payload -> hop_count + 1 ;
373
+ fhss_structure -> own_hop = payload -> hop_count + 1 ;
374
374
}
375
- fhss_stats_update (fhss_structure , STATS_FHSS_HOP_COUNT , fhss_structure -> bs -> own_hop );
375
+ fhss_stats_update (fhss_structure , STATS_FHSS_HOP_COUNT , fhss_structure -> own_hop );
376
376
fhss_structure -> bs -> channel_list_counter = payload -> channel_list_counter ;
377
377
fhss_structure -> bs -> current_channel_index = payload -> channel_index ;
378
378
uint8_t mac_address [8 ];
@@ -427,7 +427,7 @@ static int fhss_sync_with_beacon(fhss_structure_t *fhss_structure,
427
427
fhss_beacon_periodic_start (fhss_structure , fhss_structure -> bs -> synch_interval + beacon_interval_random );
428
428
}
429
429
// Our hop has changed, needs to inform possible children by sending Beacon
430
- if ((own_hop_tmp != 0 ) && (own_hop_tmp != fhss_structure -> bs -> own_hop )) {
430
+ if ((own_hop_tmp != 0 ) && (own_hop_tmp != fhss_structure -> own_hop )) {
431
431
fhss_structure -> bs -> send_synch_info_on_next_broadcast_channel = true;
432
432
}
433
433
ret_val = 0 ;
@@ -458,7 +458,7 @@ static uint32_t fhss_get_remaining_tx_time(fhss_structure_t *fhss_structure)
458
458
uint8_t tx_slot_up_limit = tx_slot_length ;
459
459
uint16_t superframe_length = fhss_structure -> bs -> synch_configuration .fhss_superframe_length ;
460
460
461
- if ((fhss_structure -> bs -> own_hop % 2 )) {
461
+ if ((fhss_structure -> own_hop % 2 )) {
462
462
tx_slot_up_limit += tx_slot_length ;
463
463
}
464
464
while (number_of_tx_slots -- )
@@ -645,7 +645,7 @@ static int fhss_reset(fhss_structure_t *fhss_structure)
645
645
fhss_structure -> bs -> current_channel_index = 0 ;
646
646
fhss_structure -> bs -> channel_list_counter = 0 ;
647
647
if (fhss_is_synch_root (fhss_structure ) == false) {
648
- fhss_structure -> bs -> own_hop = 0xff ;
648
+ fhss_structure -> own_hop = 0xff ;
649
649
}
650
650
fhss_structure -> bs -> tx_allowed = false;
651
651
fhss_structure -> bs -> synch_interval = (uint32_t ) (fhss_structure -> bs -> fhss_configuration .fhss_max_synch_interval /BEACON_INTERVAL_INIT_DIVIDER ) * 1000 ;
@@ -1031,7 +1031,7 @@ static void fhss_update_channel_callback(fhss_structure_t *fhss_structure)
1031
1031
// If channel is broadcast channel (true), send event
1032
1032
if (fhss_change_to_next_channel (fhss_structure ) == true) {
1033
1033
// Only if device is border router
1034
- if (fhss_structure -> bs -> own_hop == 0 ) {
1034
+ if (fhss_structure -> own_hop == 0 ) {
1035
1035
fhss_trig_event (fhss_structure , FHSS_BROADCAST_CHANNEL );
1036
1036
}
1037
1037
}
@@ -1068,7 +1068,7 @@ static void fhss_beacon_build(fhss_structure_t *fhss_structure, uint8_t* dest)
1068
1068
// should be the case as the superframe length field is also in that range.
1069
1069
temp_payload .remaining_slots = (uint16_t ) fhss_get_remaining_time_to_next_superframe (fhss_structure );
1070
1070
temp_payload .channel_list_counter = fhss_structure -> bs -> channel_list_counter ;
1071
- temp_payload .hop_count = fhss_structure -> bs -> own_hop ;
1071
+ temp_payload .hop_count = fhss_structure -> own_hop ;
1072
1072
temp_payload .number_of_broadcast_channels = config -> fhss_number_of_bc_channels ;
1073
1073
temp_payload .number_of_tx_slots = config -> fhss_number_of_tx_slots ;
1074
1074
temp_payload .time_since_last_beacon = 0 ; // XXX not available yet
@@ -1303,7 +1303,7 @@ int8_t fhss_set_synch_configuration(fhss_structure_t *fhss_structure, const fhss
1303
1303
return -4 ;
1304
1304
}
1305
1305
fhss_structure -> bs -> synch_configuration = * fhss_synch_configuration ;
1306
- fhss_structure -> bs -> own_hop = 0 ;
1306
+ fhss_structure -> own_hop = 0 ;
1307
1307
return 0 ;
1308
1308
}
1309
1309
0 commit comments