mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
ieee802154/hal: add set config addr filter
This commit is contained in:
parent
eb7282db0a
commit
70815e012b
@ -338,6 +338,16 @@ typedef enum {
|
||||
IEEE802154_SRC_MATCH_EXT_CLEAR,
|
||||
} ieee802154_src_match_t;
|
||||
|
||||
/**
|
||||
* @brief Address filter command
|
||||
*/
|
||||
typedef enum {
|
||||
IEEE802154_AF_SHORT_ADDR, /**< Set short IEEE 802.15.4 address (network_uint16_t) */
|
||||
IEEE802154_AF_EXT_ADDR, /**< Set extended IEEE 802.15.4 address (eui64_t) */
|
||||
IEEE802154_AF_PANID, /**< Set PAN ID (uint16_t) */
|
||||
IEEE802154_AF_PAN_COORD, /**< Set device as PAN coordinator (bool) */
|
||||
} ieee802154_af_cmd_t;
|
||||
|
||||
/**
|
||||
* @brief Frame Filter mode
|
||||
*/
|
||||
@ -645,6 +655,7 @@ struct ieee802154_radio_ops {
|
||||
* - @ref set_cca_threshold
|
||||
* - @ref set_cca_mode
|
||||
* - @ref config_phy
|
||||
* - @ref config_addr_filter
|
||||
* - @ref set_csma_params
|
||||
* - @ref set_rx_mode
|
||||
* - @ref set_hw_addr_filter
|
||||
@ -861,6 +872,23 @@ struct ieee802154_radio_ops {
|
||||
*/
|
||||
int (*set_frame_filter_mode)(ieee802154_dev_t *dev, ieee802154_filter_mode_t mode);
|
||||
|
||||
/**
|
||||
* @brief Configure the address filter.
|
||||
*
|
||||
* This functions is used for configuring the address filter parameters
|
||||
* required by the IEEE 802.15.4 standard.
|
||||
*
|
||||
* @pre the device is on
|
||||
*
|
||||
* @param[in] dev IEEE802.15.4 device descriptor
|
||||
* @param[in] cmd command for the address filter
|
||||
* @param[in] value value for @p cmd.
|
||||
*
|
||||
* @return 0 on success
|
||||
* @return negative errno on error
|
||||
*/
|
||||
int (*config_addr_filter)(ieee802154_dev_t *dev, ieee802154_af_cmd_t cmd, const void *value);
|
||||
|
||||
/**
|
||||
* @brief Set the source address match configuration.
|
||||
*
|
||||
@ -1051,6 +1079,24 @@ static inline int ieee802154_radio_set_hw_addr_filter(ieee802154_dev_t *dev,
|
||||
return dev->driver->set_hw_addr_filter(dev, short_addr, ext_addr, pan_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Shortcut to @ref ieee802154_radio_ops::config_addr_filter
|
||||
*
|
||||
* @pre the device is on
|
||||
*
|
||||
* @param[in] dev IEEE802.15.4 device descriptor
|
||||
* @param[in] cmd command for the address filter
|
||||
* @param[in] value value for @p cmd.
|
||||
*
|
||||
* @return result of @ref ieee802154_radio_ops::config_addr_filter
|
||||
*/
|
||||
static inline int ieee802154_radio_config_addr_filter(ieee802154_dev_t *dev,
|
||||
ieee802154_af_cmd_t cmd,
|
||||
const void* value)
|
||||
{
|
||||
return dev->driver->config_addr_filter(dev, cmd, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Shortcut to @ref ieee802154_radio_ops::set_frame_filter_mode
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user