drivers/include/net/netdev/ieee802154.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef NET_NETDEV_IEEE802154_H
21 #define NET_NETDEV_IEEE802154_H
22 
23 #include "net/ieee802154.h"
24 #include "net/gnrc/nettype.h"
25 #include "net/netopt.h"
26 #include "net/netdev.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
42 #define NETDEV_IEEE802154_SEND_MASK (0x0028)
43 #define NETDEV_IEEE802154_RAW (0x0002)
47 #define NETDEV_IEEE802154_SRC_MODE_LONG (0x0004)
48 
51 #define NETDEV_IEEE802154_SECURITY_EN (IEEE802154_FCF_SECURITY_EN)
52 
56 #define NETDEV_IEEE802154_ACK_REQ (IEEE802154_FCF_ACK_REQ)
57 
61 #define NETDEV_IEEE802154_FRAME_PEND (IEEE802154_FCF_FRAME_PEND)
62 
71 typedef enum {
80 
89 typedef struct {
95 #ifdef MODULE_GNRC
96  gnrc_nettype_t proto;
97 #endif
98 
102  uint16_t pan;
103 
107  uint8_t short_addr[IEEE802154_SHORT_ADDRESS_LEN];
108 
112  uint8_t long_addr[IEEE802154_LONG_ADDRESS_LEN];
113  uint8_t seq;
114  uint8_t chan;
115  uint16_t flags;
118 
123 
137 int netdev_ieee802154_get(netdev_ieee802154_t *dev, netopt_t opt, void *value,
138  size_t max_len);
139 
166 int netdev_ieee802154_set(netdev_ieee802154_t *dev, netopt_t opt, const void *value,
167  size_t value_len);
168 
169 #ifdef __cplusplus
170 }
171 #endif
172 
173 #endif /* NET_NETDEV_IEEE802154_H */
174 
Definitions low-level network driver interface.
UWB preamble sense based on the SHR of a frame.
uint16_t flags
flags as defined above
netdev_t netdev
netdev_t base class
UWB preamble sense based on the packet with the multiplexed preamble.
IEEE 802.15.4 header definitions.
Received packet status information for most radios.
Definition: netdev.h:249
netopt_t
Global list of configuration options available throughout the network stack, e.g. ...
Definition: netopt.h:42
Carrier sense with energy above threshold.
uint16_t pan
IEEE 802.15.4 specific fields.
Structure to hold driver state.
Definition: netdev.h:275
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.
Definition of global configuration options.
netdev_ieee802154_cca_mode_t
Option parameter to be used with NETOPT_CCA_MODE to set the mode of the clear channel assessment (CCA...
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.
gnrc_nettype_t
Definition of protocol types in the network stack.
Definition: nettype.h:42
#define IEEE802154_SHORT_ADDRESS_LEN
IEEE 802.15.4 address lengths.
Extended structure to hold IEEE 802.15.4 driver state.
#define IEEE802154_LONG_ADDRESS_LEN
long address (EUI-64)
Protocol type definitions.