OpenWSN Firmware
schedule.h File Reference
#include "openwsn.h"

Go to the source code of this file.

Data Structures

struct  scheduleEntry_t
 
struct  debugScheduleEntry_t
 
struct  slotinfo_element_t
 
struct  schedule_vars_t
 

Macros

#define SUPERFRAME_LENGTH   11
 The length of the superframe, in slots. More...
 
#define NUMADVSLOTS   1
 
#define NUMSHAREDTXRX   5
 
#define NUMSERIALRX   3
 
#define MAXACTIVESLOTS   (NUMADVSLOTS+NUMSHAREDTXRX+NUMSERIALRX)
 Maximum number of active slots in a superframe. More...
 
#define MINBE   2
 Minimum backoff exponent. More...
 
#define MAXBE   4
 Maximum backoff exponent. More...
 
#define SCHEDULE_MINIMAL_6TISCH_ACTIVE_CELLS   5
 
#define SCHEDULE_MINIMAL_6TISCH_EB_CELLS   1
 
#define SCHEDULE_MINIMAL_6TISCH_SLOTFRAME_SIZE   101
 
#define SCHEDULE_MINIMAL_6TISCH_DEFAULT_SLOTFRAME_HANDLE   1
 
#define SCHEDULE_MINIMAL_6TISCH_DEFAULT_SLOTFRAME_NUMBER   1
 

Typedefs

typedef uint8_t channelOffset_t
 
typedef uint16_t slotOffset_t
 
typedef uint16_t frameLength_t
 

Enumerations

enum  cellType_t {
  CELLTYPE_OFF = 0, CELLTYPE_ADV = 1, CELLTYPE_TX = 2, CELLTYPE_RX = 3,
  CELLTYPE_TXRX = 4, CELLTYPE_SERIALRX = 5, CELLTYPE_MORESERIALRX = 6
}
 

Functions

void schedule_init (void)
 Initialize this module. More...
 
bool debugPrint_schedule (void)
 Trigger this module to print status information, over serial. More...
 
bool debugPrint_backoff (void)
 Trigger this module to print status information, over serial. More...
 
void schedule_setFrameLength (frameLength_t newFrameLength)
 Set frame length. More...
 
owerror_t schedule_addActiveSlot (slotOffset_t slotOffset, cellType_t type, bool shared, uint8_t channelOffset, open_addr_t *neighbor)
 Add a new active slot into the schedule. More...
 
void schedule_getSlotInfo (slotOffset_t slotOffset, open_addr_t *neighbor, slotinfo_element_t *info)
 Get the information of a specific slot. More...
 
owerror_t schedule_removeActiveSlot (slotOffset_t slotOffset, open_addr_t *neighbor)
 Remove an active slot from the schedule. More...
 
bool schedule_isSlotOffsetAvailable (uint16_t slotOffset)
 
void schedule_syncSlotOffset (slotOffset_t targetSlotOffset)
 
void schedule_advanceSlot (void)
 advance to next active slot More...
 
slotOffset_t schedule_getNextActiveSlotOffset (void)
 return slotOffset of next active slot More...
 
frameLength_t schedule_getFrameLength (void)
 Get the frame length. More...
 
cellType_t schedule_getType (void)
 Get the type of the current schedule entry. More...
 
void schedule_getNeighbor (open_addr_t *addrToWrite)
 Get the neighbor associated wit the current schedule entry. More...
 
channelOffset_t schedule_getChannelOffset (void)
 Get the channel offset of the current schedule entry. More...
 
bool schedule_getOkToSend (void)
 Check whether I can send on this slot. More...
 
void schedule_resetBackoff (void)
 Reset the backoff and backoffExponent. More...
 
void schedule_indicateRx (asn_t *asnTimestamp)
 Indicate the reception of a packet. More...
 
void schedule_indicateTx (asn_t *asnTimestamp, bool succesfullTx)
 Indicate the transmission of a packet. More...