Files | |
file | ieee802154.h |
Definitions for netdev common IEEE 802.15.4 code. | |
Data Structures | |
struct | netdev_ieee802154_t |
Extended structure to hold IEEE 802.15.4 driver state. More... | |
Typedefs | |
typedef struct netdev_radio_rx_info | netdev_ieee802154_rx_info_t |
Received packet status information for IEEE 802.15.4 radios. | |
Enumerations | |
enum | netdev_ieee802154_cca_mode_t { NETDEV_IEEE802154_CCA_MODE_1 = 1, NETDEV_IEEE802154_CCA_MODE_2, NETDEV_IEEE802154_CCA_MODE_3, NETDEV_IEEE802154_CCA_MODE_4, NETDEV_IEEE802154_CCA_MODE_5, NETDEV_IEEE802154_CCA_MODE_6 } |
Option parameter to be used with NETOPT_CCA_MODE to set the mode of the clear channel assessment (CCA) defined in Std 802.15.4. More... | |
Functions | |
void | netdev_ieee802154_reset (netdev_ieee802154_t *dev) |
Reset function for ieee802154 common fields. More... | |
int | netdev_ieee802154_get (netdev_ieee802154_t *dev, netopt_t opt, void *value, size_t max_len) |
Fallback function for netdev IEEE 802.15.4 devices' _get function. More... | |
int | netdev_ieee802154_set (netdev_ieee802154_t *dev, netopt_t opt, const void *value, size_t value_len) |
Fallback function for netdev IEEE 802.15.4 devices' _set function. More... | |
int | netdev_ieee802154_dst_filter (netdev_ieee802154_t *dev, const uint8_t *mhr) |
This function compares destination address and pan id with addresses and pan id of the device. More... | |
static void | netdev_ieee802154_setup (netdev_ieee802154_t *dev) |
Configure the hardware address of a IEEE 802.15.4 devices. More... | |
IEEE 802.15.4 netdev flags | |
Flags for netdev_ieee802154_t::flags The flag-space | |
#define | NETDEV_IEEE802154_SEND_MASK (0x0028) |
flags to take for send packets | |
#define | NETDEV_IEEE802154_RAW (0x0002) |
pass raw frame to upper layer | |
#define | NETDEV_IEEE802154_SRC_MODE_LONG (0x0004) |
use long source address (set) or short source address (unset) | |
#define | NETDEV_IEEE802154_SECURITY_EN (IEEE802154_FCF_SECURITY_EN) |
enable security | |
#define | NETDEV_IEEE802154_ACK_REQ (IEEE802154_FCF_ACK_REQ) |
request ACK from receiver | |
#define | NETDEV_IEEE802154_FRAME_PEND (IEEE802154_FCF_FRAME_PEND) |
set frame pending bit | |
Option parameter to be used with NETOPT_CCA_MODE to set the mode of the clear channel assessment (CCA) defined in Std 802.15.4.
Definition at line 72 of file ieee802154.h.
int netdev_ieee802154_dst_filter | ( | netdev_ieee802154_t * | dev, |
const uint8_t * | mhr | ||
) |
This function compares destination address and pan id with addresses and pan id of the device.
this function is meant top be used by drivers that do not support address filtering in hw
[in] | dev | network device descriptor |
[in] | mhr | mac header |
int netdev_ieee802154_get | ( | netdev_ieee802154_t * | dev, |
netopt_t | opt, | ||
void * | value, | ||
size_t | max_len | ||
) |
Fallback function for netdev IEEE 802.15.4 devices' _get function.
Supposed to be used by netdev drivers as default case.
[in] | dev | network device descriptor |
[in] | opt | option type |
[out] | value | pointer to store the option's value in |
[in] | max_len | maximal amount of byte that fit into value |
value
void netdev_ieee802154_reset | ( | netdev_ieee802154_t * | dev | ) |
Reset function for ieee802154 common fields.
Supposed to be used by netdev drivers to reset the ieee802154 fields when resetting the device
[in] | dev | network device descriptor |
int netdev_ieee802154_set | ( | netdev_ieee802154_t * | dev, |
netopt_t | opt, | ||
const void * | value, | ||
size_t | value_len | ||
) |
Fallback function for netdev IEEE 802.15.4 devices' _set function.
Sets netdev_ieee802154_t::pan, netdev_ieee802154_t::short_addr, and netdev_ieee802154_t::long_addr in device struct. Additionally NETDEV_IEEE802154_SRC_MODE_LONG, NETDEV_IEEE802154_RAW and, NETDEV_IEEE802154_ACK_REQ in netdev_ieee802154_t::flags can be set or unset.
The setting of netdev_ieee802154_t::chan is omitted since the legality of its value can be very device specific and can't be checked in this function. Please set it in the netdev_driver_t::set function of your driver.
Be aware that this only manipulates the netdev_ieee802154_t struct. Configuration to the device needs to be done in the netdev_driver_t::set function of the device driver (which should call this function as a fallback afterwards).
[in] | dev | network device descriptor |
[in] | opt | option type |
[in] | value | value to set |
[in] | value_len | the length of value |
value
|
inlinestatic |
Configure the hardware address of a IEEE 802.15.4 devices.
This will obtain a long and short address based on the netdev ID. The addresses is stored in the netdev's long_addr
& short_addr
. The caller must take care of writing them to the hardware.
[out] | dev | Netdev to configure |
Definition at line 209 of file ieee802154.h.