37 #ifndef INSTABURST_TX_H__ 38 #define INSTABURST_TX_H__ 66 #include "instaburst.h" 67 #include "broadcast.h" 68 #include "adv_ext_tx.h" 69 #include "bearer_event.h" 70 #include "packet_buffer.h" 71 #include "bearer_handler.h" 76 #define INSTABURST_TX_BUFFER_MIN_SIZE \ 77 (sizeof(packet_buffer_packet_t) + sizeof(adv_ext_tx_event_t) + \ 78 (sizeof(adv_ext_tx_packet_t) + ADV_EXT_PACKET_LEN_MAX) * ADV_EXT_TX_CHAIN_MAX_COUNT) 119 #ifdef INSTABURST_TX_DEBUG 123 uint32_t failed_allocs;
124 uint32_t tx_regular_packet;
127 } instaburst_tx_debug_t;
138 uint8_t channel_index;
140 packet_buffer_t packet_buffer;
147 broadcast_t broadcast;
148 adv_ext_tx_t adv_ext_tx;
150 bearer_event_sequential_t tx_complete_event;
151 timestamp_t prev_tx_timestamp;
153 timer_event_t timer_event;
155 #ifdef INSTABURST_TX_DEBUG 156 instaburst_tx_debug_t debug;
177 uint8_t * p_packet_buffer,
178 uint32_t packet_buffer_size);
280 return p_instaburst->config.interval_ms;
300 return p_instaburst->config.tx_power;
Instaburst TX configuration.
void instaburst_tx_enable(instaburst_tx_t *p_instaburst)
Enables the given Instaburst instance.
uint8_t channel_count
Number of channels in the p_channels array.
uint8_t * p_next_alloc
Pointer to the next location to allocate a buffer in.
radio_mode_t radio_mode
Radio mode to run auxiliary packets in.
bool instaburst_tx_finalize(instaburst_tx_t *p_instaburst)
Finalizes the TX event under construction, putting it up for transmission.
Instaburst instance structure.
const uint8_t * p_channels
Array of radio channels to send on.
radio_tx_power_t tx_power
TX power to transmit auxiliary packets at.
void instaburst_tx_tx_power_set(instaburst_tx_t *p_instaburst, radio_tx_power_t tx_power)
Sets the TX power for the given Instaburst instance.
void instaburst_tx_buffer_lock(bool lock)
Locks the current buffer to prevent it from being automatically transmitted on the next advertisement...
static uint32_t instaburst_tx_interval_get(const instaburst_tx_t *p_instaburst)
Gets the TX interval for the given Instaburst instance.
uint32_t nrf_mesh_tx_token_t
TX Token type, used as a context parameter to notify the application of ended transmissions.
void instaburst_tx_buffer_commit(instaburst_tx_t *p_instaburst, const uint8_t *p_buffer)
Commits the given buffer for transmission.
packet_buffer_packet_t * p_alloc_buf
Buffer currently being used for allocating new packets.
void(* instaburst_tx_complete_t)(struct instaburst_tx *p_tx, nrf_mesh_tx_token_t tx_token, timestamp_t timestamp)
TX Complete callback to be called when all repeats of a buffer have been sent.
uint8_t set_id
Set ID for this Instaburst instance.
uint8_t * instaburst_tx_buffer_alloc(instaburst_tx_t *p_instaburst, uint32_t data_len, nrf_mesh_tx_token_t tx_token)
Allocates a buffer for transmission.
adv_ext_tx_packet_t * p_alloc_packet
Packet being built in the allocate stage.
void instaburst_tx_init(uint32_t lfclk_ppm)
Initializes the Instaburst TX module.
static radio_tx_power_t instaburst_tx_tx_power_get(const instaburst_tx_t *p_instaburst)
Gets the TX power for the given Instaburst instance.
void instaburst_tx_disable(instaburst_tx_t *p_instaburst)
Disables the given Instaburst instance.
void instaburst_tx_buffer_discard(instaburst_tx_t *p_instaburst, const uint8_t *p_buffer)
Discards the given buffer, freeing any memory associated with it.
instaburst_tx_complete_t callback
Callback to call when the transmission was completed.
void instaburst_tx_instance_init(instaburst_tx_t *p_instaburst, const instaburst_tx_config_t *p_config, uint8_t *p_packet_buffer, uint32_t packet_buffer_size)
Initializes an Instaburst TX instance.
void instaburst_tx_interval_set(instaburst_tx_t *p_instaburst, uint32_t interval_ms)
Sets the TX interval for the given Instaburst instance.
packet_buffer_packet_t * p_tx_buf
Buffer currently in transmission.
uint32_t interval_ms
Transmission interval in milliseconds.
bool instaburst_tx_is_enabled(const instaburst_tx_t *p_instaburst)
Checks if the Instaburst instance is enabled.