Loading...
Searching...
No Matches
ieee802154_radio_ops Struct Reference

Radio ops struct declaration. More...

Detailed Description

Radio ops struct declaration.

Definition at line 489 of file radio.h.

#include <radio.h>

Data Fields

const uint32_t caps
 Radio device capabilities.
 
int(* write )(ieee802154_dev_t *dev, const iolist_t *psdu)
 Write a frame into the framebuffer.
 
int(* len )(ieee802154_dev_t *dev)
 Get the length of the received PSDU frame.
 
int(* read )(ieee802154_dev_t *dev, void *buf, size_t size, ieee802154_rx_info_t *info)
 Read a frame from the internal framebuffer.
 
int(* off )(ieee802154_dev_t *dev)
 Turn off the device.
 
int(* request_on )(ieee802154_dev_t *dev)
 Request to turn on the device.
 
int(* confirm_on )(ieee802154_dev_t *dev)
 Confirmation function for ieee802154_radio_ops::request_on.
 
int(* request_op )(ieee802154_dev_t *dev, ieee802154_hal_op_t op, void *ctx)
 Request a radio operation.
 
int(* confirm_op )(ieee802154_dev_t *dev, ieee802154_hal_op_t op, void *ctx)
 Confirmation function for ieee802154_radio_ops::request_op.
 
int(* set_cca_threshold )(ieee802154_dev_t *dev, int8_t threshold)
 Set the threshold for the Energy Detection (first mode of CCA)
 
int(* set_cca_mode )(ieee802154_dev_t *dev, ieee802154_cca_mode_t mode)
 Set CCA mode.
 
int(* config_phy )(ieee802154_dev_t *dev, const ieee802154_phy_conf_t *conf)
 Set IEEE802.15.4 PHY configuration (channel, TX power)
 
int(* set_frame_retrans )(ieee802154_dev_t *dev, uint8_t retrans)
 Set number of frame retransmissions.
 
int(* set_csma_params )(ieee802154_dev_t *dev, const ieee802154_csma_be_t *bd, int8_t retries)
 Set the CSMA-CA parameters.
 
int(* set_frame_filter_mode )(ieee802154_dev_t *dev, ieee802154_filter_mode_t mode)
 Set the frame filter moder.
 
int(* config_addr_filter )(ieee802154_dev_t *dev, ieee802154_af_cmd_t cmd, const void *value)
 Configure the address filter.
 
int(* config_src_addr_match )(ieee802154_dev_t *dev, ieee802154_src_match_t cmd, const void *value)
 Set the source address match configuration.
 

Field Documentation

◆ caps

const uint32_t ieee802154_radio_ops::caps

Radio device capabilities.

This field contains bitflags of supported capabilities (ieee802154_rf_caps_t) by the device.

Definition at line 496 of file radio.h.

◆ config_addr_filter

int(* ieee802154_radio_ops::config_addr_filter) (ieee802154_dev_t *dev, ieee802154_af_cmd_t cmd, const void *value)

Configure the address filter.

This functions is used for configuring the address filter parameters required by the IEEE 802.15.4 standard.

Precondition
the device is on
Parameters
[in]devIEEE802.15.4 device descriptor
[in]cmdcommand for the address filter
[in]valuevalue for cmd.
Returns
0 on success
negative errno on error

Definition at line 756 of file radio.h.

◆ config_phy

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

Precondition
the device is on
the transceiver state is IDLE.
Parameters
[in]devIEEE802.15.4 device descriptor
[in]confthe PHY configuration
Returns
0 on success
-EINVAL if the configuration is not valid for the device.
<0 error, return value is negative errno indicating the cause.

Definition at line 689 of file radio.h.

◆ config_src_addr_match

int(* ieee802154_radio_ops::config_src_addr_match) (ieee802154_dev_t *dev, ieee802154_src_match_t cmd, const void *value)

Set the source address match configuration.

This function configures the source address match filter in order to set the Frame Pending bit in ACK frames accordingly. In case the radio doesn't support IEEE802154_CAP_SRC_ADDR_MATCH, this functions is used to activate the Frame Pending bit for all ACK frames (in order to be compliant with the IEEE 802.15.4 standard).

Precondition
the device is on
Parameters
[in]devIEEE802.15.4 device descriptor
[in]cmdcommand for the source address match configuration
[in]valuevalue associated to cmd.
Returns
0 on success
negative errno on error

Definition at line 776 of file radio.h.

◆ confirm_on

int(* ieee802154_radio_ops::confirm_on) (ieee802154_dev_t *dev)

Confirmation function for ieee802154_radio_ops::request_on.

Precondition
call to ieee802154_radio_ops::request_on was successful.
Postcondition
the transceiver state is IDLE During boot or in case the radio doesn't support IEEE802154_CAP_REG_RETENTION when off was called, the Physical Information Base will be undefined. Thus, take into consideration that the following functions should be called right after the radio is turned on again:
Parameters
[in]devIEEE802.15.4 device descriptor
Returns
0 if the device is on
-EAGAIN if the device is still busy turning on
negative errno on error

Definition at line 606 of file radio.h.

◆ confirm_op

int(* ieee802154_radio_ops::confirm_op) (ieee802154_dev_t *dev, ieee802154_hal_op_t op, void *ctx)

Confirmation function for ieee802154_radio_ops::request_op.

This function must be called to finish a given ieee802154_hal_op_t.

Parameters
[in]devIEEE802.15.4 device descriptor
[in]opoperation to be confirmed
[in]ctxoperation specific context
Returns
status of the request
Return values
0on success
negativeerrno on error

Definition at line 639 of file radio.h.

◆ len

int(* ieee802154_radio_ops::len) (ieee802154_dev_t *dev)

Get the length of the received PSDU frame.

Precondition
the device is on
the radio already received a frame (e.g ieee802154_dev::cb with IEEE802154_RADIO_INDICATION_RX_DONE).
Postcondition
the frame buffer is still protected against new frame arrivals.
Parameters
[in]devIEEE802.15.4 device descriptor
Returns
length of the frame

Definition at line 525 of file radio.h.

◆ off

int(* ieee802154_radio_ops::off) (ieee802154_dev_t *dev)

Turn off the device.

Parameters
[in]devIEEE802.15.4 device descriptor

When this function returns, the radio shall be off.

Postcondition
the device is off
Returns
0 on success
negative errno on error

Definition at line 563 of file radio.h.

◆ read

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. If the radio provides any kind of framebuffer protection, this function should release it.

Postcondition
Don't call this function if there was no reception event (either IEEE802154_RADIO_INDICATION_RX_DONE or IEEE802154_RADIO_INDICATION_CRC_ERROR). Otherwise there's risk of RX underflow.
Parameters
[in]devIEEE802.15.4 device descriptor
[out]bufbuffer to write the received PSDU frame into.
[in]sizesize of buf
[in]infoinformation of the received frame (LQI, RSSI). Can be NULL if this information is not needed.
Returns
number of bytes written in buffer (0 if buf == NULL)
-ENOBUFS if the frame doesn't fit in

Definition at line 550 of file radio.h.

◆ request_on

int(* ieee802154_radio_ops::request_on) (ieee802154_dev_t *dev)

Request to turn on the device.

Note
ieee802154_radio_ops::confirm_on MUST be used to finish the procedure.
Precondition
the init function of the radio succeeded.
Parameters
[in]devIEEE802.15.4 device descriptor
Returns
0 on success
negative errno on error

Definition at line 578 of file radio.h.

◆ request_op

int(* ieee802154_radio_ops::request_op) (ieee802154_dev_t *dev, ieee802154_hal_op_t op, void *ctx)

Request a radio operation.

This functions is used to request a radio operation. See ieee802154_hal_op_t for a list of available operations.

Parameters
[in]devIEEE802.15.4 device descriptor
[in]opoperation to be executed
[in]ctxoperation specific context
Returns
status of the request
Return values
0on success
negativeerrno on error

Definition at line 623 of file radio.h.

◆ set_cca_mode

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).

Precondition
the device is on
Parameters
[in]devIEEE802.15.4 device descriptor
[in]modethe CCA mode
Returns
0 on success
-ENOTSUP if the mode is not supported
negative errno on error

Definition at line 668 of file radio.h.

◆ set_cca_threshold

int(* ieee802154_radio_ops::set_cca_threshold) (ieee802154_dev_t *dev, int8_t threshold)

Set the threshold for the Energy Detection (first mode of CCA)

Precondition
the device is on
Parameters
[in]devIEEE802.15.4 device descriptor
[in]thresholdthe threshold in dBm.
Returns
0 on success
negative errno on error

Definition at line 652 of file radio.h.

◆ set_csma_params

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.

Precondition
the device is on
Parameters
[in]devIEEE802.15.4 device descriptor
[in]bdparameters of the exponential backoff. If NULL, the parameters are not altered.
[in]retriesnumber of CSMA-CA retries. If retries < 0, retransmissions with CSMA-CA MUST be disabled. If retries == 0, the ieee802154_radio_request_transmit function is equivalent to CCA send.
Returns
0 on success
-EINVAL if the settings are not supported.
negative errno on error

Definition at line 725 of file radio.h.

◆ set_frame_filter_mode

int(* ieee802154_radio_ops::set_frame_filter_mode) (ieee802154_dev_t *dev, ieee802154_filter_mode_t mode)

Set the frame filter moder.

Precondition
the device is on
Parameters
[in]devIEEE802.15.4 device descriptor
[in]modeaddress filter mode
Returns
0 on success
negative errno on error

Definition at line 739 of file radio.h.

◆ set_frame_retrans

int(* ieee802154_radio_ops::set_frame_retrans) (ieee802154_dev_t *dev, uint8_t retrans)

Set number of frame retransmissions.

Precondition
the device is on
Note
this function pointer can be NULL if the device doesn't support frame retransmissions
Parameters
[in]devIEEE802.15.4 device descriptor
[in]retransthe number of retransmissions attempts.
Returns
0 on success
negative errno on error

Definition at line 705 of file radio.h.

◆ write

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.

Parameters
[in]devIEEE802.15.4 device descriptor
[in]psduPSDU frame to be sent
Returns
0 on success
negative errno on error

Definition at line 510 of file radio.h.


The documentation for this struct was generated from the following file: