From f7f8a571a2525ef4189da512cb2ea8845cfce8cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20H=C3=BC=C3=9Fler?= Date: Sun, 8 Jun 2025 19:43:28 +0200 Subject: [PATCH] ieee802154: add ieee802154_radio_has_capability --- sys/include/net/ieee802154/radio.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/include/net/ieee802154/radio.h b/sys/include/net/ieee802154/radio.h index c69fe0d331..b141bcb216 100644 --- a/sys/include/net/ieee802154/radio.h +++ b/sys/include/net/ieee802154/radio.h @@ -818,6 +818,20 @@ struct ieee802154_radio_ops { const void *value); }; +/** + * @brief Check if the device has a specific capability + * + * @param[in] dev IEEE802.15.4 device descriptor + * @param[in] cap capabilities to check for + * + * @retval true if the device has the capability + * @retval false if the device doesn't have the capability + */ +static inline bool ieee802154_radio_has_capability(ieee802154_dev_t *dev, uint32_t cap) +{ + return (dev->driver->caps & cap) == cap; +} + /** * @brief Shortcut to @ref ieee802154_radio_ops::write *