OpenWSN Firmware
IEEE802154E

IEEE802.15.4e TSCH. More...

Data Structures

struct  IEEE802154E_ACK_ht
 
struct  ieee154e_vars_t
 
struct  ieee154e_stats_t
 
struct  ieee154e_dbg_t
 

Macros

#define SYNCHRONIZING_CHANNEL   20
 
#define TXRETRIES   3
 
#define TX_POWER   31
 
#define RESYNCHRONIZATIONGUARD   5
 
#define US_PER_TICK   30
 
#define ADVTIMEOUT   30
 
#define MAXKAPERIOD   2000
 
#define DESYNCTIMEOUT   2333
 
#define LIMITLARGETIMECORRECTION   5
 
#define LENGTH_IEEE154_MAX   128
 
#define DUTY_CYCLE_WINDOW_LIMIT   (0xFFFFFFFF>>1)
 
#define IEEE802154E_PAYLOAD_DESC_LEN_SHIFT   0x04
 
#define IEEE802154E_PAYLOAD_DESC_GROUP_ID_MLME   (1<<1)
 
#define IEEE802154E_DESC_TYPE_LONG   0x01
 
#define IEEE802154E_DESC_TYPE_SHORT   0x00
 
#define IEEE802154E_DESC_TYPE_HEADER_IE   0x00
 
#define IEEE802154E_DESC_TYPE_PAYLOAD_IE   0x01
 
#define IEEE802154E_DESC_LEN_HEADER_IE_MASK   0xFE00
 
#define IEEE802154E_DESC_LEN_PAYLOAD_IE_MASK   0xFFE0
 
#define IEEE802154E_DESC_LEN_HEADER_IE_SHIFT   9
 
#define IEEE802154E_DESC_LEN_PAYLOAD_IE_SHIFT   5
 
#define IEEE802154E_DESC_ELEMENTID_HEADER_IE_MASK   0x01FE
 
#define IEEE802154E_DESC_GROUPID_PAYLOAD_IE_MASK   0x001E
 
#define IEEE802154E_DESC_ELEMENTID_HEADER_IE_SHIFT   1
 
#define IEEE802154E_DESC_GROUPID_PAYLOAD_IE_SHIFT   1
 
#define IEEE802154E_DESC_LEN_LONG_MLME_IE_MASK   0xFFE0
 
#define IEEE802154E_DESC_SUBID_LONG_MLME_IE_MASK   0x001E
 
#define IEEE802154E_DESC_LEN_LONG_MLME_IE_SHIFT   5
 
#define IEEE802154E_DESC_SUBID_LONG_MLME_IE_SHIFT   1
 
#define IEEE802154E_DESC_LEN_SHORT_MLME_IE_MASK   0xFF00
 
#define IEEE802154E_DESC_SUBID_SHORT_MLME_IE_MASK   0x00FE
 
#define IEEE802154E_DESC_LEN_SHORT_MLME_IE_SHIFT   8
 
#define IEEE802154E_DESC_SUBID_SHORT_MLME_IE_SHIFT   1
 
#define IEEE802154E_MLME_SYNC_IE_SUBID   0x1A
 
#define IEEE802154E_MLME_SYNC_IE_SUBID_SHIFT   1
 
#define IEEE802154E_MLME_SLOTFRAME_LINK_IE_SUBID   0x1B
 
#define IEEE802154E_MLME_SLOTFRAME_LINK_IE_SUBID_SHIFT   1
 
#define IEEE802154E_MLME_TIMESLOT_IE_SUBID   0x1c
 
#define IEEE802154E_MLME_TIMESLOT_IE_SUBID_SHIFT   1
 
#define IEEE802154E_MLME_IE_GROUPID   0x01
 
#define IEEE802154E_ACK_NACK_TIMECORRECTION_ELEMENTID   0x1E
 
#define FIRST_FRAME_BYTE   1
 
#define DURATION_tt1   ieee154e_vars.lastCapturedTime+TsTxOffset-delayTx-maxTxDataPrepare
 
#define DURATION_tt2   ieee154e_vars.lastCapturedTime+TsTxOffset-delayTx
 
#define DURATION_tt3   ieee154e_vars.lastCapturedTime+TsTxOffset-delayTx+wdRadioTx
 
#define DURATION_tt4   ieee154e_vars.lastCapturedTime+wdDataDuration
 
#define DURATION_tt5   ieee154e_vars.lastCapturedTime+TsTxAckDelay-TsShortGT-delayRx-maxRxAckPrepare
 
#define DURATION_tt6   ieee154e_vars.lastCapturedTime+TsTxAckDelay-TsShortGT-delayRx
 
#define DURATION_tt7   ieee154e_vars.lastCapturedTime+TsTxAckDelay+TsShortGT
 
#define DURATION_tt8   ieee154e_vars.lastCapturedTime+wdAckDuration
 
#define DURATION_rt1   ieee154e_vars.lastCapturedTime+TsTxOffset-TsLongGT-delayRx-maxRxDataPrepare
 
#define DURATION_rt2   ieee154e_vars.lastCapturedTime+TsTxOffset-TsLongGT-delayRx
 
#define DURATION_rt3   ieee154e_vars.lastCapturedTime+TsTxOffset+TsLongGT
 
#define DURATION_rt4   ieee154e_vars.lastCapturedTime+wdDataDuration
 
#define DURATION_rt5   ieee154e_vars.lastCapturedTime+TsTxAckDelay-delayTx-maxTxAckPrepare
 
#define DURATION_rt6   ieee154e_vars.lastCapturedTime+TsTxAckDelay-delayTx
 
#define DURATION_rt7   ieee154e_vars.lastCapturedTime+TsTxAckDelay-delayTx+wdRadioTx
 
#define DURATION_rt8   ieee154e_vars.lastCapturedTime+wdAckDuration
 
#define ADV_PAYLOAD_LENGTH
 

Enumerations

enum  ieee154e_state_t {
  S_SLEEP = 0x00, S_SYNCLISTEN = 0x01, S_SYNCRX = 0x02, S_SYNCPROC = 0x03,
  S_TXDATAOFFSET = 0x04, S_TXDATAPREPARE = 0x05, S_TXDATAREADY = 0x06, S_TXDATADELAY = 0x07,
  S_TXDATA = 0x08, S_RXACKOFFSET = 0x09, S_RXACKPREPARE = 0x0a, S_RXACKREADY = 0x0b,
  S_RXACKLISTEN = 0x0c, S_RXACK = 0x0d, S_TXPROC = 0x0e, S_RXDATAOFFSET = 0x0f,
  S_RXDATAPREPARE = 0x10, S_RXDATAREADY = 0x11, S_RXDATALISTEN = 0x12, S_RXDATA = 0x13,
  S_TXACKOFFSET = 0x14, S_TXACKPREPARE = 0x15, S_TXACKREADY = 0x16, S_TXACKDELAY = 0x17,
  S_TXACK = 0x18, S_RXPROC = 0x19
}
 
enum  ieee154e_atomicdurations_enum {
  TsTxOffset = 131, TsLongGT = 43, TsTxAckDelay = 151, TsShortGT = 16,
  TsSlotDuration = PORT_TsSlotDuration, maxTxDataPrepare = PORT_maxTxDataPrepare, maxRxAckPrepare = PORT_maxRxAckPrepare, maxRxDataPrepare = PORT_maxRxDataPrepare,
  maxTxAckPrepare = PORT_maxTxAckPrepare, delayTx = PORT_delayTx, delayRx = PORT_delayRx, wdRadioTx = 33,
  wdDataDuration = 164, wdAckDuration = 98
}
 
enum  ieee154e_linkOption_enum { FLAG_TX_S = 7, FLAG_RX_S = 6, FLAG_SHARED_S = 5, FLAG_TIMEKEEPING_S = 4 }
 

Functions

void ieee154e_init (void)
 This function initializes this module. More...
 
PORT_RADIOTIMER_WIDTH ieee154e_asnDiff (asn_t *someASN)
 
bool ieee154e_isSynch (void)
 
void ieee154e_getAsn (uint8_t *array)
 
void ieee154e_startOfFrame (PORT_RADIOTIMER_WIDTH capturedTime)
 Indicates the radio just received the first byte of a packet. More...
 
void ieee154e_endOfFrame (PORT_RADIOTIMER_WIDTH capturedTime)
 Indicates the radio just received the last byte of a packet. More...
 
bool debugPrint_asn (void)
 Trigger this module to print status information, over serial. More...
 
bool debugPrint_isSync (void)
 Trigger this module to print status information, over serial. More...
 
bool debugPrint_macStats (void)
 Trigger this module to print status information, over serial. More...
 

Detailed Description

IEEE802.15.4e TSCH.

Author
Branko Kerkez bkerk.nosp@m.ez@b.nosp@m.erkel.nosp@m.ey.e.nosp@m.du, March 2011
Fabien Chraim chrai.nosp@m.m@ee.nosp@m.cs.be.nosp@m.rkel.nosp@m.ey.ed.nosp@m.u, June 2011
Thomas Watteyne watte.nosp@m.yne@.nosp@m.eecs..nosp@m.berk.nosp@m.eley..nosp@m.edu, August 2011

Macro Definition Documentation

#define ADV_PAYLOAD_LENGTH
Value:
sizeof(payload_IE_ht) + \
sizeof(mlme_IE_ht) + \
sizeof(sync_IE_ht)
MLME IE common header.
Definition: processIE.h:68
Header of payload IEs.
Definition: processIE.h:46
TSCH Synchronization IE.
Definition: processIE.h:77
#define ADVTIMEOUT   30
#define DESYNCTIMEOUT   2333
#define DURATION_rt1   ieee154e_vars.lastCapturedTime+TsTxOffset-TsLongGT-delayRx-maxRxDataPrepare
#define DURATION_rt2   ieee154e_vars.lastCapturedTime+TsTxOffset-TsLongGT-delayRx
#define DURATION_rt3   ieee154e_vars.lastCapturedTime+TsTxOffset+TsLongGT
#define DURATION_rt4   ieee154e_vars.lastCapturedTime+wdDataDuration
#define DURATION_rt5   ieee154e_vars.lastCapturedTime+TsTxAckDelay-delayTx-maxTxAckPrepare
#define DURATION_rt6   ieee154e_vars.lastCapturedTime+TsTxAckDelay-delayTx
#define DURATION_rt7   ieee154e_vars.lastCapturedTime+TsTxAckDelay-delayTx+wdRadioTx
#define DURATION_rt8   ieee154e_vars.lastCapturedTime+wdAckDuration
#define DURATION_tt1   ieee154e_vars.lastCapturedTime+TsTxOffset-delayTx-maxTxDataPrepare
#define DURATION_tt2   ieee154e_vars.lastCapturedTime+TsTxOffset-delayTx
#define DURATION_tt3   ieee154e_vars.lastCapturedTime+TsTxOffset-delayTx+wdRadioTx
#define DURATION_tt4   ieee154e_vars.lastCapturedTime+wdDataDuration
#define DURATION_tt5   ieee154e_vars.lastCapturedTime+TsTxAckDelay-TsShortGT-delayRx-maxRxAckPrepare
#define DURATION_tt6   ieee154e_vars.lastCapturedTime+TsTxAckDelay-TsShortGT-delayRx
#define DURATION_tt7   ieee154e_vars.lastCapturedTime+TsTxAckDelay+TsShortGT
#define DURATION_tt8   ieee154e_vars.lastCapturedTime+wdAckDuration
#define DUTY_CYCLE_WINDOW_LIMIT   (0xFFFFFFFF>>1)
#define FIRST_FRAME_BYTE   1

When a packet is received, it is written inside the OpenQueueEntry_t->packet buffer, starting at the byte defined below. When a packet is relayed, it traverses the stack in which the MAC and IPHC headers are parsed and stripped off, then put on again. During that process, the IPv6 hop limit field is decremented. Depending on the new value of the hop limit, the IPHC header compression algorithm might not be able to compress it, and hence has to carry it inline, adding a byte to the header. To avoid having to move bytes around inside OpenQueueEntry_t->packet buffer, we start writing the received packet a bit after the start of the packet.

#define IEEE802154E_ACK_NACK_TIMECORRECTION_ELEMENTID   0x1E
#define IEEE802154E_DESC_ELEMENTID_HEADER_IE_MASK   0x01FE
#define IEEE802154E_DESC_ELEMENTID_HEADER_IE_SHIFT   1
#define IEEE802154E_DESC_GROUPID_PAYLOAD_IE_MASK   0x001E
#define IEEE802154E_DESC_GROUPID_PAYLOAD_IE_SHIFT   1
#define IEEE802154E_DESC_LEN_HEADER_IE_MASK   0xFE00
#define IEEE802154E_DESC_LEN_HEADER_IE_SHIFT   9
#define IEEE802154E_DESC_LEN_LONG_MLME_IE_MASK   0xFFE0
#define IEEE802154E_DESC_LEN_LONG_MLME_IE_SHIFT   5
#define IEEE802154E_DESC_LEN_PAYLOAD_IE_MASK   0xFFE0
#define IEEE802154E_DESC_LEN_PAYLOAD_IE_SHIFT   5
#define IEEE802154E_DESC_LEN_SHORT_MLME_IE_MASK   0xFF00
#define IEEE802154E_DESC_LEN_SHORT_MLME_IE_SHIFT   8
#define IEEE802154E_DESC_SUBID_LONG_MLME_IE_MASK   0x001E
#define IEEE802154E_DESC_SUBID_LONG_MLME_IE_SHIFT   1
#define IEEE802154E_DESC_SUBID_SHORT_MLME_IE_MASK   0x00FE
#define IEEE802154E_DESC_SUBID_SHORT_MLME_IE_SHIFT   1
#define IEEE802154E_DESC_TYPE_HEADER_IE   0x00
#define IEEE802154E_DESC_TYPE_LONG   0x01
#define IEEE802154E_DESC_TYPE_PAYLOAD_IE   0x01
#define IEEE802154E_DESC_TYPE_SHORT   0x00
#define IEEE802154E_MLME_IE_GROUPID   0x01
#define IEEE802154E_MLME_SLOTFRAME_LINK_IE_SUBID   0x1B
#define IEEE802154E_MLME_SLOTFRAME_LINK_IE_SUBID_SHIFT   1
#define IEEE802154E_MLME_SYNC_IE_SUBID   0x1A
#define IEEE802154E_MLME_SYNC_IE_SUBID_SHIFT   1
#define IEEE802154E_MLME_TIMESLOT_IE_SUBID   0x1c
#define IEEE802154E_MLME_TIMESLOT_IE_SUBID_SHIFT   1
#define IEEE802154E_PAYLOAD_DESC_GROUP_ID_MLME   (1<<1)
#define IEEE802154E_PAYLOAD_DESC_LEN_SHIFT   0x04
#define LENGTH_IEEE154_MAX   128
#define LIMITLARGETIMECORRECTION   5
#define MAXKAPERIOD   2000
#define RESYNCHRONIZATIONGUARD   5
#define SYNCHRONIZING_CHANNEL   20
#define TX_POWER   31
#define TXRETRIES   3
#define US_PER_TICK   30

Enumeration Type Documentation

Enumerator
TsTxOffset 
TsLongGT 
TsTxAckDelay 
TsShortGT 
TsSlotDuration 
maxTxDataPrepare 
maxRxAckPrepare 
maxRxDataPrepare 
maxTxAckPrepare 
delayTx 
delayRx 
wdRadioTx 
wdDataDuration 
wdAckDuration 
Enumerator
FLAG_TX_S 
FLAG_RX_S 
FLAG_SHARED_S 
FLAG_TIMEKEEPING_S 
Enumerator
S_SLEEP 
S_SYNCLISTEN 
S_SYNCRX 
S_SYNCPROC 
S_TXDATAOFFSET 
S_TXDATAPREPARE 
S_TXDATAREADY 
S_TXDATADELAY 
S_TXDATA 
S_RXACKOFFSET 
S_RXACKPREPARE 
S_RXACKREADY 
S_RXACKLISTEN 
S_RXACK 
S_TXPROC 
S_RXDATAOFFSET 
S_RXDATAPREPARE 
S_RXDATAREADY 
S_RXDATALISTEN 
S_RXDATA 
S_TXACKOFFSET 
S_TXACKPREPARE 
S_TXACKREADY 
S_TXACKDELAY 
S_TXACK 
S_RXPROC 

Function Documentation

bool debugPrint_asn ( void  )

Trigger this module to print status information, over serial.

debugPrint_* functions are used by the openserial module to continuously print status information about several modules in the OpenWSN stack.

Returns
TRUE if this function printed something, FALSE otherwise.
bool debugPrint_isSync ( void  )

Trigger this module to print status information, over serial.

debugPrint_* functions are used by the openserial module to continuously print status information about several modules in the OpenWSN stack.

Returns
TRUE if this function printed something, FALSE otherwise.
bool debugPrint_macStats ( void  )

Trigger this module to print status information, over serial.

debugPrint_* functions are used by the openserial module to continuously print status information about several modules in the OpenWSN stack.

Returns
TRUE if this function printed something, FALSE otherwise.
PORT_RADIOTIMER_WIDTH ieee154e_asnDiff ( asn_t someASN)

/brief Difference between some older ASN and the current ASN.

Parameters
[in]someASNsome ASN to compare to the current
Returns
The ASN difference, or 0xffff if more than 65535 different
void ieee154e_endOfFrame ( PORT_RADIOTIMER_WIDTH  capturedTime)

Indicates the radio just received the last byte of a packet.

This function executes in ISR mode.

void ieee154e_getAsn ( uint8_t *  array)
void ieee154e_init ( void  )

This function initializes this module.

Call this function once before any other function in this module, possibly during boot-up.

bool ieee154e_isSynch ( void  )
void ieee154e_startOfFrame ( PORT_RADIOTIMER_WIDTH  capturedTime)

Indicates the radio just received the first byte of a packet.

This function executes in ISR mode.