hdr.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Daniel Krebs
3  * 2016 INRIA
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
21 #ifndef NET_GNRC_LWMAC_HDR_H
22 #define NET_GNRC_LWMAC_HDR_H
23 
24 #include <stdint.h>
25 #include <stdbool.h>
26 
27 #include "net/ieee802154.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
36 #define GNRC_LWMAC_FRAMETYPE_WR (0x01U)
37 
41 #define GNRC_LWMAC_FRAMETYPE_WA (0x02U)
42 
46 #define GNRC_LWMAC_FRAMETYPE_DATA (0x03U)
47 
51 #define GNRC_LWMAC_FRAMETYPE_DATA_PENDING (0x04U)
52 
56 #define GNRC_LWMAC_FRAMETYPE_BROADCAST (0x05U)
57 
61 typedef struct {
63  uint8_t len;
65 
69 #define GNRC_LWMAC_L2_ADDR_INITIAL { { 0 }, 0 }
70 
74 typedef struct {
75  uint8_t type;
77 
81 typedef struct __attribute__((packed)) {
85 
89 typedef struct __attribute__((packed)) {
92  uint32_t current_phase;
94 
98 typedef struct __attribute__((packed)) {
100  uint8_t seq_nr;
102 
106 typedef struct __attribute__((packed)) {
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #endif /* NET_GNRC_LWMAC_HDR_H */
115 
gnrc_lwmac_l2_addr_t::len
uint8_t len
address
Definition: hdr.h:63
ieee802154.h
IEEE 802.15.4 header definitions.
gnrc_lwmac_frame_broadcast_t::seq_nr
uint8_t seq_nr
Broadcast sequence.
Definition: hdr.h:100
gnrc_lwmac_frame_wa_t
LWMAC WA (wake-up answer packet, i.e., preamble-ACK packet) frame.
Definition: hdr.h:89
gnrc_lwmac_frame_data_t
LWMAC unicast data frame.
Definition: hdr.h:106
gnrc_lwmac_frame_wr_t
LWMAC WR (wake-up request packet, i.e., preamble packet) frame.
Definition: hdr.h:81
gnrc_lwmac_hdr_t::type
uint8_t type
type of frame
Definition: hdr.h:75
gnrc_lwmac_frame_broadcast_t
LWMAC broadcast data frame.
Definition: hdr.h:98
gnrc_lwmac_frame_wa_t::header
gnrc_lwmac_hdr_t header
WA packet header type.
Definition: hdr.h:90
gnrc_lwmac_hdr_t
LWMAC header.
Definition: hdr.h:74
gnrc_lwmac_frame_wr_t::dst_addr
gnrc_lwmac_l2_addr_t dst_addr
WR is broadcast, so destination address needed.
Definition: hdr.h:83
gnrc_lwmac_frame_broadcast_t::header
gnrc_lwmac_hdr_t header
Broadcast packet header type.
Definition: hdr.h:99
gnrc_lwmac_frame_wa_t::current_phase
uint32_t current_phase
Node's current phase value.
Definition: hdr.h:92
gnrc_lwmac_frame_wr_t::header
gnrc_lwmac_hdr_t header
WR packet header type.
Definition: hdr.h:82
gnrc_lwmac_l2_addr_t
LWMAC internal L2 address structure.
Definition: hdr.h:61
gnrc_lwmac_frame_data_t::header
gnrc_lwmac_hdr_t header
Data packet header type.
Definition: hdr.h:107
IEEE802154_LONG_ADDRESS_LEN
#define IEEE802154_LONG_ADDRESS_LEN
long address (EUI-64)
Definition: ieee802154.h:44
gnrc_lwmac_frame_wa_t::dst_addr
gnrc_lwmac_l2_addr_t dst_addr
WA is broadcast, so destination address needed.
Definition: hdr.h:91