Radio ops struct declaration. More...
#include <radio.h>
Data Fields | |
int(* | write )(ieee802154_dev_t *dev, const iolist_t *psdu) |
Write a frame into the framebuffer. More... | |
int(* | request_transmit )(ieee802154_dev_t *dev) |
Request the transmission of a preloaded frame. More... | |
int(* | confirm_transmit )(ieee802154_dev_t *dev, ieee802154_tx_info_t *info) |
Confirmation function for ieee802154_radio_ops::request_transmit. More... | |
int(* | len )(ieee802154_dev_t *dev) |
Get the length of the received PSDU frame. More... | |
int(* | read )(ieee802154_dev_t *dev, void *buf, size_t size, ieee802154_rx_info_t *info) |
Read a frame from the internal framebuffer. More... | |
int(* | off )(ieee802154_dev_t *dev) |
Turn off the device. More... | |
int(* | request_on )(ieee802154_dev_t *dev) |
Request to turn on the device. More... | |
int(* | confirm_on )(ieee802154_dev_t *dev) |
Confirmation function for ieee802154_radio_ops::request_on. More... | |
int(* | request_set_trx_state )(ieee802154_dev_t *dev, ieee802154_trx_state_t state) |
Request a PHY state change. More... | |
int(* | confirm_set_trx_state )(ieee802154_dev_t *dev) |
Confirmation function for ieee802154_radio_ops::request_set_trx_state. More... | |
int(* | request_cca )(ieee802154_dev_t *dev) |
Request Stand-Alone Clear Channel Assessment. More... | |
int(* | confirm_cca )(ieee802154_dev_t *dev) |
Confirmation function for ieee802154_radio_ops::request_cca. More... | |
bool(* | get_cap )(ieee802154_dev_t *dev, ieee802154_rf_caps_t cap) |
Get a cap from the radio. More... | |
int(* | set_cca_threshold )(ieee802154_dev_t *dev, int8_t threshold) |
Set the threshold for the Energy Detection (first mode of CCA) More... | |
int(* | set_cca_mode )(ieee802154_dev_t *dev, ieee802154_cca_mode_t mode) |
Set CCA mode. More... | |
int(* | config_phy )(ieee802154_dev_t *dev, const ieee802154_phy_conf_t *conf) |
Set IEEE802.15.4 PHY configuration (channel, TX power) More... | |
int(* | set_hw_addr_filter )(ieee802154_dev_t *dev, const network_uint16_t *short_addr, const eui64_t *ext_addr, const uint16_t *pan_id) |
Set IEEE802.15.4 addresses in hardware address filter. More... | |
int(* | set_frame_retrans )(ieee802154_dev_t *dev, uint8_t retrans) |
Set number of frame retransmissions. More... | |
int(* | set_csma_params )(ieee802154_dev_t *dev, const ieee802154_csma_be_t *bd, int8_t retries) |
Set the CSMA-CA parameters. More... | |
int(* | set_rx_mode )(ieee802154_dev_t *dev, ieee802154_rx_mode_t mode) |
Set the RX mode. More... | |
int(* ieee802154_radio_ops::config_phy) (ieee802154_dev_t *dev, const ieee802154_phy_conf_t *conf) |
Set IEEE802.15.4 PHY configuration (channel, TX power)
This function SHOULD NOT validate the PHY configurations unless it's specific to the device. The upper layer is responsible of all kind of validations. In case a configuration is not valid (e.g parameters out of range), this function should return -EINVAL
[in] | dev | IEEE802.15.4 device descriptor |
[in] | conf | the PHY configuration |
int(* ieee802154_radio_ops::confirm_cca) (ieee802154_dev_t *dev) |
Confirmation function for ieee802154_radio_ops::request_cca.
This function must be called to finish the CCA procedure. This function should be called on IEEE802154_RADIO_CONFIRM_CCA, If no interrupt is available, this function can be polled.
[in] | dev | IEEE802.15.4 device descriptor |
int(* ieee802154_radio_ops::confirm_on) (ieee802154_dev_t *dev) |
Confirmation function for ieee802154_radio_ops::request_on.
[in] | dev | IEEE802.15.4 device descriptor |
int(* ieee802154_radio_ops::confirm_set_trx_state) (ieee802154_dev_t *dev) |
Confirmation function for ieee802154_radio_ops::request_set_trx_state.
[in] | dev | IEEE802.15.4 device descriptor |
int(* ieee802154_radio_ops::confirm_transmit) (ieee802154_dev_t *dev, ieee802154_tx_info_t *info) |
Confirmation function for ieee802154_radio_ops::request_transmit.
This function must be called to finish the transmission procedure and get the transmission status. This function should be called on IEEE802154_RADIO_CONFIRM_TX_DONE. If no interrupt is available, this function can be polled.
[in] | dev | IEEE802.15.4 device descriptor |
[out] | info | the TX information. Pass NULL if the information is not needed. If the radio supports AutoCCA, the status should indicate transmission done or channel busy. If the radio supports frame retransmissions, the status should indicate if medium was busy, no ACK was received or transmission succeeded. |
bool(* ieee802154_radio_ops::get_cap) (ieee802154_dev_t *dev, ieee802154_rf_caps_t cap) |
int(* ieee802154_radio_ops::len) (ieee802154_dev_t *dev) |
Get the length of the received PSDU frame.
[in] | dev | IEEE802.15.4 device descriptor |
int(* ieee802154_radio_ops::off) (ieee802154_dev_t *dev) |
Turn off the device.
[in] | dev | IEEE802.15.4 device descriptor |
When this function returns, the radio shall be off.
int(* ieee802154_radio_ops::read) (ieee802154_dev_t *dev, void *buf, size_t size, ieee802154_rx_info_t *info) |
Read a frame from the internal framebuffer.
This function reads the received frame from the internal framebuffer. It should try to copy the received PSDU frame into buf
. The FCS field will not be copied and its size not be taken into account for the return value.
[in] | dev | IEEE802.15.4 device descriptor |
[out] | buf | buffer to write the received PSDU frame into. |
[in] | size | size of buf |
[in] | info | information of the received frame (LQI, RSSI). Can be NULL if this information is not needed. |
buffer
(0 if buf
== NULL)
int(* ieee802154_radio_ops::request_cca) (ieee802154_dev_t *dev) |
Request Stand-Alone Clear Channel Assessment.
[in] | dev | IEEE802.15.4 device descriptor |
int(* ieee802154_radio_ops::request_on) (ieee802154_dev_t *dev) |
Request to turn on the device.
[in] | dev | IEEE802.15.4 device descriptor |
int(* ieee802154_radio_ops::request_set_trx_state) (ieee802154_dev_t *dev, ieee802154_trx_state_t state) |
Request a PHY state change.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | state | the new state |
int(* ieee802154_radio_ops::request_transmit) (ieee802154_dev_t *dev) |
Request the transmission of a preloaded frame.
ieee802154_radio_ops::confirm_transmit MUST be used to finish the transmission.
[in] | dev | IEEE802.15.4 device descriptor |
int(* ieee802154_radio_ops::set_cca_mode) (ieee802154_dev_t *dev, ieee802154_cca_mode_t mode) |
Set CCA mode.
All radios MUST at least implement the first CCA mode (ED Threshold).
[in] | dev | IEEE802.15.4 device descriptor |
[in] | mode | the CCA mode |
int(* ieee802154_radio_ops::set_cca_threshold) (ieee802154_dev_t *dev, int8_t threshold) |
int(* ieee802154_radio_ops::set_csma_params) (ieee802154_dev_t *dev, const ieee802154_csma_be_t *bd, int8_t retries) |
Set the CSMA-CA parameters.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | bd | parameters of the exponential backoff. If NULL, the parameters are not altered. |
[in] | retries | number of CSMA-CA retries. If retries < 0, retransmissions with CSMA-CA MUST be disabled. If retries == 0, the ieee802154_radio_ops::request_transmit function is equivalent to CCA send. |
int(* ieee802154_radio_ops::set_frame_retrans) (ieee802154_dev_t *dev, uint8_t retrans) |
Set number of frame retransmissions.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | retrans | the number of retransmissions attempts. |
int(* ieee802154_radio_ops::set_hw_addr_filter) (ieee802154_dev_t *dev, const network_uint16_t *short_addr, const eui64_t *ext_addr, const uint16_t *pan_id) |
Set IEEE802.15.4 addresses in hardware address filter.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | short_addr | the IEEE802.15.4 short address. If NULL, the short address is not altered.. |
[in] | ext_addr | the IEEE802.15.4 extended address (Network Byte Order). If NULL, the extended address is not altered. |
[in] | pan_id | the IEEE802.15.4 PAN ID. If NULL, the PAN ID is not altered. |
int(* ieee802154_radio_ops::set_rx_mode) (ieee802154_dev_t *dev, ieee802154_rx_mode_t mode) |
int(* ieee802154_radio_ops::write) (ieee802154_dev_t *dev, const iolist_t *psdu) |
Write a frame into the framebuffer.
This function shouldn't do any checks, so the frame MUST be valid. The previous content of the framebuffer is replaced by psdu
.
[in] | dev | IEEE802.15.4 device descriptor |
[in] | psdu | PSDU frame to be sent |