802.15.4 radio drivers

NETDEV_IEEE802154_SEND_MASK

flags to take for send packets

1
(0x0028)
NETDEV_IEEE802154_RAW

pass raw frame to upper layer

1
(0x0002)
NETDEV_IEEE802154_SRC_MODE_LONG

use long source addres (set) or short source address (unset)

1
(0x0004)
NETDEV_IEEE802154_SECURITY_EN

enable security

1
(IEEE802154_FCF_SECURITY_EN)
NETDEV_IEEE802154_ACK_REQ

request ACK from receiver

1
(IEEE802154_FCF_ACK_REQ)
NETDEV_IEEE802154_FRAME_PEND

set frame pending bit

1
(IEEE802154_FCF_FRAME_PEND)
enum netdev_ieee802154_cca_mode_t
NETDEV_IEEE802154_CCA_MODE_1 = 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.
struct netdev_radio_rx_info netdev_ieee802154_rx_info_t

Received packet status information for IEEE 802.15.4 radios.

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

Parameters

dev:network device descriptor

int netdev_ieee802154_get(netdev_ieee802154_t * dev, netopt.h::netopt_t opt, void * value, msp430_types.h::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

dev:network device descriptor
opt:option type
value:pointer to store the option’s value in
max_len:maximal amount of byte that fit into value

Return values

  • number of bytes written to value
  • <0 on error
int netdev_ieee802154_set(netdev_ieee802154_t * dev, netopt.h::netopt_t opt, const void * value, msp430_types.h::size_t value_len)

Fallback function for netdev IEEE 802.15.4 devices’ _set function.

Sets drivers/include/net/netdev/ieee802154.h::netdev_ieee802154_t::pan, drivers/include/net/netdev/ieee802154.h::netdev_ieee802154_t::short_addr, and drivers/include/net/netdev/ieee802154.h::netdev_ieee802154_t::long_addr in device struct. Additionally drivers/include/net/netdev/ieee802154.h::NETDEV_IEEE802154_SRC_MODE_LONG, drivers/include/net/netdev/ieee802154.h::NETDEV_IEEE802154_RAW and, drivers/include/net/netdev/ieee802154.h::NETDEV_IEEE802154_ACK_REQ in drivers/include/net/netdev/ieee802154.h::netdev_ieee802154_t::flags can be set or unset.

The setting of drivers/include/net/netdev/ieee802154.h::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.h::netdev_driver::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.h::netdev_driver::set function of the device driver (which should call this function as a fallback afterwards).

Parameters

dev:network device descriptor
opt:option type
value:value to set
value_len:the length of value

Return values

  • number of bytes used from value
  • <0 on error
struct netdev_ieee802154_t

Extended structure to hold IEEE 802.15.4 driver state.

Supposed to be extended by driver implementations. The extended structure should contain all variable driver state.

uint16_t pan

IEEE 802.15.4 specific fields.

PAN ID in network byte order

uint8_t short_addr()

Short address in network byte order.

uint8_t long_addr()

Long address in network byte order.

uint8_t seq

sequence number

uint8_t chan

channel

uint16_t flags

flags as defined above

netdev.h::netdev_t netdev

netdev.h::netdev_t base class