OpenWSN Firmware
IEEE802154E.h File Reference
#include "openwsn.h"
#include "board.h"
#include "schedule.h"
#include "processIE.h"

Go to the source code of this file.

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...