drivers: ieee802154: nrf: set TX power selectively
This commit extends Nordic's ieee802154 driver with the possibility to set Tx power for every transmission separately. Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
This commit is contained in:
parent
adca70c0fa
commit
847f68ae10
1 changed files with 18 additions and 0 deletions
|
@ -440,6 +440,12 @@ static bool nrf5_tx_immediate(struct net_pkt *pkt, uint8_t *payload, bool cca)
|
|||
.dynamic_data_is_set = pkt->ieee802154_mac_hdr_rdy,
|
||||
},
|
||||
.cca = cca,
|
||||
.tx_power = {
|
||||
.use_metadata_value = IS_ENABLED(CONFIG_IEEE802154_SELECTIVE_TXPOWER),
|
||||
#if defined(CONFIG_IEEE802154_SELECTIVE_TXPOWER)
|
||||
.power = pkt->ieee802154_txpwr,
|
||||
#endif
|
||||
},
|
||||
};
|
||||
|
||||
return nrf_802154_transmit_raw(payload, &metadata);
|
||||
|
@ -453,6 +459,12 @@ static bool nrf5_tx_csma_ca(struct net_pkt *pkt, uint8_t *payload)
|
|||
.is_secured = pkt->ieee802154_frame_secured,
|
||||
.dynamic_data_is_set = pkt->ieee802154_mac_hdr_rdy,
|
||||
},
|
||||
.tx_power = {
|
||||
.use_metadata_value = IS_ENABLED(CONFIG_IEEE802154_SELECTIVE_TXPOWER),
|
||||
#if defined(CONFIG_IEEE802154_SELECTIVE_TXPOWER)
|
||||
.power = pkt->ieee802154_txpwr,
|
||||
#endif
|
||||
},
|
||||
};
|
||||
|
||||
return nrf_802154_transmit_csma_ca_raw(payload, &metadata);
|
||||
|
@ -536,6 +548,12 @@ static bool nrf5_tx_at(struct net_pkt *pkt, uint8_t *payload, bool cca)
|
|||
},
|
||||
.cca = cca,
|
||||
.channel = nrf_802154_channel_get(),
|
||||
.tx_power = {
|
||||
.use_metadata_value = IS_ENABLED(CONFIG_IEEE802154_SELECTIVE_TXPOWER),
|
||||
#if defined(CONFIG_IEEE802154_SELECTIVE_TXPOWER)
|
||||
.power = pkt->ieee802154_txpwr,
|
||||
#endif
|
||||
},
|
||||
};
|
||||
uint64_t tx_at = target_time_convert_to_64_bits(net_pkt_txtime(pkt) / NSEC_PER_USEC);
|
||||
bool ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue