OpenWSN Firmware
processIE.h
Go to the documentation of this file.
1 #ifndef __PROCESSIE_H
2 #define __PROCESSIE_H
3 
4 #include "openwsn.h"
5 
6 //=========================== define ==========================================
7 
8 // maximum of cells in a Schedule IE
9 #define SCHEDULEIEMAXNUMCELLS 3
10 
11 // subIE shift
12 #define MLME_IE_SUBID_SHIFT 1
13 
14 // subIEs identifier
15 #define MLME_IE_SUBID_CHANNELHOPPING 0x09
16 #define MLME_IE_SUBID_SYNC 0x1A
17 #define MLME_IE_SUBID_SLOTFRAME_LINK 0x1B
18 #define MLME_IE_SUBID_TIMESLOT 0x1c
19 #define MLME_IE_SUBID_LINKTYPE 0x40
20 #define MLME_IE_SUBID_OPCODE 0x41
21 #define MLME_IE_SUBID_BANDWIDTH 0x42
22 #define MLME_IE_SUBID_TRACKID 0x43
23 #define MLME_IE_SUBID_SCHEDULE 0x44
24 
25 // ========================== typedef =========================================
26 
27 BEGIN_PACK
28 
29 typedef struct {
30  uint16_t tsNum;
31  uint16_t choffset;
32  uint8_t linkoptions;
33 } cellInfo_ht;
34 
35 
39 typedef struct{
41 } header_IE_ht;
42 
46 typedef struct{
49 
50 //======= header IEs
51 
57 typedef struct {
58  int16_t timesync_info;
60 
61 //======= payload IEs
62 
68 typedef struct{
70 } mlme_IE_ht;
71 
77 typedef struct {
78  uint8_t asn[5];
79  uint8_t join_priority;
80 } sync_IE_ht;
81 
87 typedef struct {
88  uint8_t slotframehandle;
89  uint16_t slotframesize;
90  uint8_t numlinks;
92 
98 typedef struct {
99  uint8_t opcode;
100 } opcode_IE_ht;
101 
107 typedef struct{
108  uint8_t slotframeID;
109  uint8_t numOfLinks;
111 
117 typedef struct{
118  uint8_t type;
119  uint8_t length;
120  uint8_t frameID;
121  uint8_t numberOfcells;
122  bool flag;
125 
126 END_PACK
127 
128 //=========================== variables =======================================
129 
130 //=========================== prototypes ======================================
131 
133  OpenQueueEntry_t* pkt,
134  uint8_t len
135 );
136 
137 //===== prepend IEs
138 
140  OpenQueueEntry_t* pkt
141 );
143  OpenQueueEntry_t* pkt
144 );
146  OpenQueueEntry_t* pkt,
147  uint8_t uResCommandID
148 );
150  OpenQueueEntry_t* pkt,
151  uint8_t numOfLinks,
152  uint8_t slotframeID
153 );
155  OpenQueueEntry_t* pkt,
156  uint8_t type,
157  uint8_t frameID,
158  uint8_t flag,
159  cellInfo_ht* cellList
160 );
161 
162 //===== retrieve IEs
163 
165  OpenQueueEntry_t* pkt,
166  uint8_t * ptr
167 );
169  OpenQueueEntry_t* pkt,
170  uint8_t* ptr,
171  opcode_IE_ht* opcodeIE
172 );
174  OpenQueueEntry_t* pkt,
175  uint8_t * ptr,
176  bandwidth_IE_ht* bandwidthIE
177 );
179  OpenQueueEntry_t* pkt,
180  uint8_t * ptr,
181  schedule_IE_ht* schedule_ie
182 );
183 
184 #endif
6top Opcode IE
Definition: processIE.h:98
#define SCHEDULEIEMAXNUMCELLS
Definition: processIE.h:9
uint8_t slotframeID
Definition: processIE.h:108
uint8_t linkoptions
Definition: processIE.h:32
TSCH ACK/NACK TimeCorrection IE.
Definition: processIE.h:57
port_INLINE void processIE_retrieveSheduleIE(OpenQueueEntry_t *pkt, uint8_t *ptr, schedule_IE_ht *scheduleInfo)
Definition: processIE.c:483
6top Generic Schedule IE
Definition: processIE.h:117
bool flag
Definition: processIE.h:122
port_INLINE uint8_t processIE_prependSyncIE(OpenQueueEntry_t *pkt)
Definition: processIE.c:43
port_INLINE uint8_t processIE_prependOpcodeIE(OpenQueueEntry_t *pkt, uint8_t uResCommandID)
Definition: processIE.c:175
6top Bandwidth IE
Definition: processIE.h:107
uint16_t length_groupid_type
Definition: processIE.h:47
uint16_t length_elementid_type
Definition: processIE.h:40
uint8_t numOfLinks
Definition: processIE.h:109
MLME IE common header.
Definition: processIE.h:68
uint8_t numberOfcells
Definition: processIE.h:121
uint8_t opcode
Definition: processIE.h:99
Header of header IEs.
Definition: processIE.h:39
port_INLINE void processIE_retrieveBandwidthIE(OpenQueueEntry_t *pkt, uint8_t *ptr, bandwidth_IE_ht *bandwidthInfo)
Definition: processIE.c:463
uint16_t length_subID_type
Definition: processIE.h:69
port_INLINE void processIE_retrieveOpcodeIE(OpenQueueEntry_t *pkt, uint8_t *ptr, opcode_IE_ht *opcodeInfo)
Definition: processIE.c:448
Header of payload IEs.
Definition: processIE.h:46
port_INLINE uint8_t processIE_prependSheduleIE(OpenQueueEntry_t *pkt, uint8_t type, uint8_t frameID, uint8_t flag, cellInfo_ht *cellList)
Definition: processIE.c:268
TSCH Synchronization IE.
Definition: processIE.h:77
uint8_t length
Definition: processIE.h:119
port_INLINE uint8_t processIE_prependSlotframeLinkIE(OpenQueueEntry_t *pkt)
Definition: processIE.c:88
uint8_t type
Definition: processIE.h:118
port_INLINE void processIE_retrieveSlotframeLinkIE(OpenQueueEntry_t *pkt, uint8_t *ptr)
Definition: processIE.c:387
uint8_t frameID
Definition: processIE.h:120
Definition: processIE.h:29
uint8_t join_priority
Definition: processIE.h:79
uint16_t tsNum
Definition: processIE.h:30
Definition: openwsn.h:288
port_INLINE void processIE_prependMLMEIE(OpenQueueEntry_t *pkt, uint8_t len)
Definition: processIE.c:18
uint16_t choffset
Definition: processIE.h:31
int16_t timesync_info
Definition: processIE.h:58
port_INLINE uint8_t processIE_prependBandwidthIE(OpenQueueEntry_t *pkt, uint8_t numOfLinks, uint8_t slotframeID)
Definition: processIE.c:215