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 
19 #ifndef NET_NETDEV_IEEE802154_H
20 #define NET_NETDEV_IEEE802154_H
21 
22 #include "net/ieee802154.h"
23 #include "net/gnrc/nettype.h"
24 #include "net/netopt.h"
25 #include "net/netdev.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
41 #define NETDEV_IEEE802154_SEND_MASK (0x0028)
42 #define NETDEV_IEEE802154_RAW (0x0002)
46 #define NETDEV_IEEE802154_SRC_MODE_LONG (0x0004)
47 
50 #define NETDEV_IEEE802154_SECURITY_EN (IEEE802154_FCF_SECURITY_EN)
51 
55 #define NETDEV_IEEE802154_ACK_REQ (IEEE802154_FCF_ACK_REQ)
56 
60 #define NETDEV_IEEE802154_FRAME_PEND (IEEE802154_FCF_FRAME_PEND)
61 
70 typedef enum {
79 
88 typedef struct {
94 #ifdef MODULE_GNRC
95  gnrc_nettype_t proto;
96 #endif
97 
101  uint16_t pan;
102 
106  uint8_t short_addr[IEEE802154_SHORT_ADDRESS_LEN];
107 
111  uint8_t long_addr[IEEE802154_LONG_ADDRESS_LEN];
112  uint8_t seq;
113  uint8_t chan;
114  uint16_t flags;
117 
122 
136 int netdev_ieee802154_get(netdev_ieee802154_t *dev, netopt_t opt, void *value,
137  size_t max_len);
138 
165 int netdev_ieee802154_set(netdev_ieee802154_t *dev, netopt_t opt, const void *value,
166  size_t value_len);
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 #endif /* NET_NETDEV_IEEE802154_H */
173 
Definitions low-level network driver interface.
Carrier sense with energy above threshold.
uint16_t flags
flags as defined above
netdev_t netdev
netdev_t base class
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
UWB preamble sense based on the packet with the multiplexed preamble.
uint16_t pan
IEEE 802.15.4 specific fields.
UWB preamble sense based on the SHR of a frame.
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.
netdev_ieee802154_cca_mode_t
Option parameter to be used with NETOPT_CCA_MODE to set the mode of the clear channel assessment (CCA...
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.
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.