@@ -270,8 +270,7 @@ lorawan_time_t LoRaPHY::update_band_timeoff(bool joined, bool duty_cycle,
270
270
271
271
// Update bands Time OFF
272
272
for (uint8_t i = 0 ; i < nb_bands; i++) {
273
-
274
- if (joined == false ) {
273
+ if (MBED_CONF_LORA_DUTY_CYCLE_ON_JOIN && joined == false ) {
275
274
uint32_t txDoneTime = MAX (_lora_time->get_elapsed_time (bands[i].last_join_tx_time ),
276
275
(duty_cycle == true ) ?
277
276
_lora_time->get_elapsed_time (bands[i].last_tx_time ) : 0 );
@@ -283,7 +282,6 @@ lorawan_time_t LoRaPHY::update_band_timeoff(bool joined, bool duty_cycle,
283
282
if (bands[i].off_time != 0 ) {
284
283
next_tx_delay = MIN (bands[i].off_time - txDoneTime, next_tx_delay);
285
284
}
286
-
287
285
} else {
288
286
// if network has been joined
289
287
if (duty_cycle == true ) {
@@ -451,7 +449,7 @@ uint8_t LoRaPHY::get_bandwidth(uint8_t dr)
451
449
}
452
450
}
453
451
454
- uint8_t LoRaPHY::enabled_channel_count (bool joined, uint8_t datarate,
452
+ uint8_t LoRaPHY::enabled_channel_count (uint8_t datarate,
455
453
const uint16_t *channel_mask,
456
454
uint8_t *channel_indices,
457
455
uint8_t *delayTx)
@@ -1182,7 +1180,7 @@ void LoRaPHY::calculate_backoff(bool joined, bool last_tx_was_join_req, bool dc_
1182
1180
// Reset time-off to initial value.
1183
1181
band_table[band_idx].off_time = 0 ;
1184
1182
1185
- if (joined == false ) {
1183
+ if (MBED_CONF_LORA_DUTY_CYCLE_ON_JOIN && joined == false ) {
1186
1184
// Get the join duty cycle
1187
1185
if (elapsed_time < 3600000 ) {
1188
1186
join_duty_cycle = BACKOFF_DC_1_HOUR;
@@ -1245,7 +1243,7 @@ lorawan_status_t LoRaPHY::set_next_channel(channel_selection_params_t *params,
1245
1243
band_table, phy_params.bands .size );
1246
1244
1247
1245
// Search how many channels are enabled
1248
- channel_count = enabled_channel_count (params->joined , params-> current_datarate ,
1246
+ channel_count = enabled_channel_count (params->current_datarate ,
1249
1247
phy_params.channels .mask ,
1250
1248
enabled_channels, &delay_tx);
1251
1249
} else {
0 commit comments