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... | |
struct | netdev_ieee802154_rx_info |
Received packet status information for IEEE 802.15.4 radios. More... | |
Typedefs | |
typedef struct netdev_ieee802154_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 | |
static void | netdev_ieee802154_rx_info_set_timestamp (netdev_ieee802154_rx_info_t *dest, uint64_t timestamp) |
Write the given timestamp to the given RX info struct. | |
static int | netdev_ieee802154_rx_info_get_timestamp (const netdev_ieee802154_rx_info_t *info, uint64_t *dest) |
Get the timestamp to from the RX info. | |
void | netdev_ieee802154_reset (netdev_ieee802154_t *dev) |
Reset function for ieee802154 common fields. | |
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. | |
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. | |
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. | |
static void | netdev_ieee802154_setup (netdev_ieee802154_t *dev) |
Configure the hardware address of a IEEE 802.15.4 devices. | |
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 | |
Flags for use in @ref netdev_ieee802154_rx_info::flags | |
#define | NETDEV_RX_IEEE802154_INFO_FLAG_TIMESTAMP (0x01) |
Timestamp valid. | |
#define NETDEV_IEEE802154_ACK_REQ (IEEE802154_FCF_ACK_REQ) |
request ACK from receiver
Definition at line 60 of file ieee802154.h.
#define NETDEV_IEEE802154_FRAME_PEND (IEEE802154_FCF_FRAME_PEND) |
set frame pending bit
Definition at line 65 of file ieee802154.h.
#define NETDEV_IEEE802154_RAW (0x0002) |
pass raw frame to upper layer
Definition at line 47 of file ieee802154.h.
#define NETDEV_IEEE802154_SECURITY_EN (IEEE802154_FCF_SECURITY_EN) |
enable security
Definition at line 55 of file ieee802154.h.
#define NETDEV_IEEE802154_SEND_MASK (0x0028) |
flags to take for send packets
Definition at line 46 of file ieee802154.h.
#define NETDEV_IEEE802154_SRC_MODE_LONG (0x0004) |
use long source address (set) or short source address (unset)
Definition at line 51 of file ieee802154.h.
#define NETDEV_RX_IEEE802154_INFO_FLAG_TIMESTAMP (0x01) |
Timestamp valid.
Definition at line 74 of file ieee802154.h.
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 82 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 |
|
inlinestatic |
Get the timestamp to from the RX info.
This function is safe to call even when module netdev_ieee802154_rx_timestamp
is not used. It will become a no-op then.
0 | Success |
-1 | No timestamp present or module netdev_ieee802154_rx_timestamp not used |
Definition at line 177 of file ieee802154.h.
|
inlinestatic |
Write the given timestamp to the given RX info struct.
This function is safe to call even when module netdev_ieee802154_rx_timestamp
is not used. It will become a no-op then.
Definition at line 154 of file ieee802154.h.
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 277 of file ieee802154.h.