This repository was archived by the owner on May 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -317,11 +317,16 @@ static bool fhss_ws_check_tx_allowed(fhss_structure_t *fhss_structure)
317
317
if (fhss_structure -> ws -> is_on_bc_channel == true) {
318
318
return true;
319
319
}
320
- uint32_t slot_len_ms = (fhss_structure -> ws -> fhss_configuration .fhss_broadcast_interval - fhss_structure -> ws -> fhss_configuration .fhss_bc_dwell_interval ) / (WS_NUMBER_OF_TX_SLOTS * 2 );
320
+ uint8_t number_of_tx_slots = ((fhss_structure -> ws -> fhss_configuration .fhss_broadcast_interval - fhss_structure -> ws -> fhss_configuration .fhss_bc_dwell_interval ) / WS_MAX_TXRX_SLOT_LEN_MS ) / 2 ;
321
+ // Allow transmission when broadcast interval is very short comparing to MAX slot length
322
+ if (!number_of_tx_slots ) {
323
+ return true;
324
+ }
325
+ uint32_t slot_len_ms = (fhss_structure -> ws -> fhss_configuration .fhss_broadcast_interval - fhss_structure -> ws -> fhss_configuration .fhss_bc_dwell_interval ) / (number_of_tx_slots * 2 );
321
326
uint32_t remaining_time_ms = fhss_structure -> platform_functions .fhss_get_remaining_slots (fhss_broadcast_handler , fhss_structure -> fhss_api ) / 1000 ;
322
327
uint32_t tx_slot_begin = (fhss_structure -> ws -> fhss_configuration .fhss_broadcast_interval - fhss_structure -> ws -> fhss_configuration .fhss_bc_dwell_interval ) - (slot_len_ms * (fhss_structure -> own_hop & 1 ));
323
328
uint32_t rx_slot_begin = tx_slot_begin - slot_len_ms ;
324
- uint8_t n_o_tx_slots = WS_NUMBER_OF_TX_SLOTS ;
329
+ uint8_t n_o_tx_slots = number_of_tx_slots ;
325
330
326
331
while (n_o_tx_slots -- ) {
327
332
if ((remaining_time_ms <= tx_slot_begin ) && (remaining_time_ms > rx_slot_begin )) {
Original file line number Diff line number Diff line change 21
21
* At least 4 channel retries must be used: (Initial channel + WS_NUMBER_OF_CHANNEL_RETRIES) * MAC attempts = (1+4)*4=20 attempts
22
22
*/
23
23
#define WS_NUMBER_OF_CHANNEL_RETRIES 4
24
- //TODO: Make this configurable
25
- #define WS_NUMBER_OF_TX_SLOTS 2
24
+ //TX/RX slot length in milliseconds
25
+ #define WS_MAX_TXRX_SLOT_LEN_MS 100
26
26
typedef struct fhss_ws fhss_ws_t ;
27
27
28
28
struct fhss_ws
You can’t perform that action at this time.
0 commit comments