drivers/include/net/netdev/ieee802154.h File Reference

Definitions for netdev common IEEE 802.15.4 code. More...

Detailed Description

Definitions for netdev common IEEE 802.15.4 code.

Author
Martine Lenders mlend.nosp@m.ers@.nosp@m.inf.f.nosp@m.u-be.nosp@m.rlin..nosp@m.de

Definition in file drivers/include/net/netdev/ieee802154.h.

#include "net/ieee802154.h"
#include "net/gnrc/nettype.h"
#include "net/netopt.h"
#include "net/netdev.h"
+ Include dependency graph for drivers/include/net/netdev/ieee802154.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  netdev_ieee802154_t
 Extended structure to hold IEEE 802.15.4 driver state. More...
 

Macros

IEEE 802.15.4 netdev flags

Flags for netdev_ieee802154_t::flags

The flag-space 0xff00 is available for device-specific flags. The flag-space 0x00ff was chosen for global flags to be in accordance to the IEEE 802.15.4 MAC header flags.

#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 addres (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
 

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

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

Enumeration Type Documentation

◆ netdev_ieee802154_cca_mode_t

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.

Enumerator
NETDEV_IEEE802154_CCA_MODE_1 

Energy above threshold.

NETDEV_IEEE802154_CCA_MODE_2 

Carrier sense only.

NETDEV_IEEE802154_CCA_MODE_3 

Carrier sense with energy above threshold.

NETDEV_IEEE802154_CCA_MODE_4 

ALOHA.

NETDEV_IEEE802154_CCA_MODE_5 

UWB preamble sense based on the SHR of a frame.

NETDEV_IEEE802154_CCA_MODE_6 

UWB preamble sense based on the packet with the multiplexed preamble.

Definition at line 65 of file drivers/include/net/netdev/ieee802154.h.

Function Documentation

◆ netdev_ieee802154_get()

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.

Parameters
[in]devnetwork device descriptor
[in]optoption type
[out]valuepointer to store the option's value in
[in]max_lenmaximal amount of byte that fit into value
Returns
number of bytes written to value
<0 on error

◆ netdev_ieee802154_set()

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

Parameters
[in]devnetwork device descriptor
[in]optoption type
[in]valuevalue to set
[in]value_lenthe length of value
Returns
number of bytes used from value
<0 on error