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 
10 #pragma once
11 
23 #include <stdint.h>
24 #include <stdbool.h>
25 
26 #include "net/ieee802154.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
35 #define GNRC_LWMAC_FRAMETYPE_WR (0x01U)
36 
40 #define GNRC_LWMAC_FRAMETYPE_WA (0x02U)
41 
45 #define GNRC_LWMAC_FRAMETYPE_DATA (0x03U)
46 
50 #define GNRC_LWMAC_FRAMETYPE_DATA_PENDING (0x04U)
51 
55 #define GNRC_LWMAC_FRAMETYPE_BROADCAST (0x05U)
56 
60 typedef struct {
62  uint8_t len;
64 
68 #define GNRC_LWMAC_L2_ADDR_INITIAL { { 0 }, 0 }
69 
73 typedef struct {
74  uint8_t type;
76 
80 typedef struct __attribute__((packed)) {
84 
88 typedef struct __attribute__((packed)) {
91  uint32_t current_phase;
93 
97 typedef struct __attribute__((packed)) {
99  uint8_t seq_nr;
101 
105 typedef struct __attribute__((packed)) {
108 
109 #ifdef __cplusplus
110 }
111 #endif
112 
#define IEEE802154_LONG_ADDRESS_LEN
long address (EUI-64)
Definition: ieee802154.h:45
LWMAC broadcast data frame.
Definition: hdr.h:97
uint8_t seq_nr
Broadcast sequence.
Definition: hdr.h:99
gnrc_lwmac_hdr_t header
Broadcast packet header type.
Definition: hdr.h:98
LWMAC unicast data frame.
Definition: hdr.h:105
gnrc_lwmac_hdr_t header
Data packet header type.
Definition: hdr.h:106
LWMAC WA (wake-up answer packet, i.e., preamble-ACK packet) frame.
Definition: hdr.h:88
uint32_t current_phase
Node's current phase value.
Definition: hdr.h:91
gnrc_lwmac_l2_addr_t dst_addr
WA is broadcast, so destination address needed.
Definition: hdr.h:90
gnrc_lwmac_hdr_t header
WA packet header type.
Definition: hdr.h:89
LWMAC WR (wake-up request packet, i.e., preamble packet) frame.
Definition: hdr.h:80
gnrc_lwmac_l2_addr_t dst_addr
WR is broadcast, so destination address needed.
Definition: hdr.h:82
gnrc_lwmac_hdr_t header
WR packet header type.
Definition: hdr.h:81
LWMAC header.
Definition: hdr.h:73
uint8_t type
type of frame
Definition: hdr.h:74
LWMAC internal L2 address structure.
Definition: hdr.h:60
uint8_t len
address
Definition: hdr.h:62
IEEE 802.15.4 header definitions.