33 #ifndef __TSCH_SCHEDULE_H__
34 #define __TSCH_SCHEDULE_H__
41 #include "net/mac/tsch/tsch-queue.h"
42 #include "net/mac/tsch/tsch-slot-operation.h"
48 #ifdef TSCH_SCHEDULE_CONF_WITH_6TISCH_MINIMAL
49 #define TSCH_SCHEDULE_WITH_6TISCH_MINIMAL TSCH_SCHEDULE_CONF_WITH_6TISCH_MINIMAL
51 #define TSCH_SCHEDULE_WITH_6TISCH_MINIMAL 1
55 #ifdef TSCH_SCHEDULE_CONF_DEFAULT_LENGTH
56 #define TSCH_SCHEDULE_DEFAULT_LENGTH TSCH_SCHEDULE_CONF_DEFAULT_LENGTH
58 #define TSCH_SCHEDULE_DEFAULT_LENGTH 7
62 #ifdef TSCH_SCHEDULE_CONF_MAX_SLOTFRAMES
63 #define TSCH_SCHEDULE_MAX_SLOTFRAMES TSCH_SCHEDULE_CONF_MAX_SLOTFRAMES
65 #define TSCH_SCHEDULE_MAX_SLOTFRAMES 4
69 #ifdef TSCH_SCHEDULE_CONF_MAX_LINKS
70 #define TSCH_SCHEDULE_MAX_LINKS TSCH_SCHEDULE_CONF_MAX_LINKS
72 #define TSCH_SCHEDULE_MAX_LINKS 32
78 #define LINK_OPTION_TX 1
79 #define LINK_OPTION_RX 2
80 #define LINK_OPTION_SHARED 4
81 #define LINK_OPTION_TIME_KEEPING 8
87 enum link_type { LINK_TYPE_NORMAL, LINK_TYPE_ADVERTISING, LINK_TYPE_ADVERTISING_ONLY };
91 struct tsch_link *next;
97 uint16_t slotframe_handle;
104 uint16_t channel_offset;
107 uint8_t link_options;
110 enum link_type link_type;
115 struct tsch_slotframe {
117 struct tsch_slotframe *next;
122 struct asn_divisor_t size;
130 int tsch_schedule_init(
void);
132 void tsch_schedule_create_minimal(
void);
134 void tsch_schedule_print(
void);
137 struct tsch_slotframe *tsch_schedule_add_slotframe(uint16_t handle, uint16_t size);
139 struct tsch_slotframe *tsch_schedule_get_slotframe_by_handle(uint16_t handle);
141 int tsch_schedule_remove_slotframe(
struct tsch_slotframe *slotframe);
143 int tsch_schedule_remove_all_slotframes(
void);
146 struct tsch_slotframe *tsch_schedule_slotframes_next(
struct tsch_slotframe *sf);
148 struct tsch_link *tsch_schedule_add_link(
struct tsch_slotframe *slotframe,
149 uint8_t link_options,
enum link_type link_type,
const linkaddr_t *address,
150 uint16_t timeslot, uint16_t channel_offset);
152 struct tsch_link *tsch_schedule_get_link_by_handle(uint16_t handle);
154 struct tsch_link *tsch_schedule_get_link_by_timeslot(
struct tsch_slotframe *slotframe, uint16_t timeslot);
156 int tsch_schedule_remove_link(
struct tsch_slotframe *slotframe,
struct tsch_link *l);
158 int tsch_schedule_remove_link_by_timeslot(
struct tsch_slotframe *slotframe, uint16_t timeslot);
161 struct tsch_link * tsch_schedule_get_next_active_link(
struct asn_t *asn, uint16_t *time_offset,
162 struct tsch_link **backup_link);
static uip_ds6_addr_t * addr
Pointer to a router list entry.
Private TSCH definitions (meant for use by TSCH implementation files only) ...
Header file for the Rime address representation
Linked list manipulation routines.
#define LIST_STRUCT(name)
Declare a linked list inside a structure declaraction.