43 static uint16_t slotframe_handle = 0;
44 static uint16_t channel_offset = 0;
45 static struct tsch_slotframe *sf_eb;
49 get_node_timeslot(
const linkaddr_t *
addr)
51 #if ORCHESTRA_EBSF_PERIOD > 0
52 return ORCHESTRA_LINKADDR_HASH(addr) % ORCHESTRA_EBSF_PERIOD;
59 select_packet(uint16_t *slotframe, uint16_t *timeslot)
62 if(packetbuf_attr(PACKETBUF_ATTR_FRAME_TYPE) == FRAME802154_BEACONFRAME) {
63 if(slotframe !=
NULL) {
64 *slotframe = slotframe_handle;
66 if(timeslot !=
NULL) {
75 new_time_source(
const struct tsch_neighbor *old,
const struct tsch_neighbor *
new)
77 uint16_t old_ts = old !=
NULL ? get_node_timeslot(&old->addr) : 0xffff;
78 uint16_t new_ts =
new !=
NULL ? get_node_timeslot(&new->addr) : 0xffff;
80 if(new_ts == old_ts) {
84 if(old_ts != 0xffff) {
88 tsch_schedule_add_link(sf_eb, LINK_OPTION_TX, LINK_TYPE_ADVERTISING_ONLY,
89 &tsch_broadcast_address, old_ts, 0);
92 tsch_schedule_remove_link_by_timeslot(sf_eb, old_ts);
95 if(new_ts != 0xffff) {
96 uint8_t link_options = LINK_OPTION_RX;
99 link_options |= LINK_OPTION_TX;
102 tsch_schedule_add_link(sf_eb, link_options, LINK_TYPE_ADVERTISING_ONLY,
103 &tsch_broadcast_address, new_ts, 0);
108 init(uint16_t sf_handle)
110 slotframe_handle = sf_handle;
111 channel_offset = sf_handle;
112 sf_eb = tsch_schedule_add_slotframe(slotframe_handle, ORCHESTRA_EBSF_PERIOD);
114 tsch_schedule_add_link(sf_eb,
116 LINK_TYPE_ADVERTISING_ONLY, &tsch_broadcast_address,
120 struct orchestra_rule eb_per_time_source = {
static uip_ds6_addr_t * addr
Pointer to a router list entry.
Header file for the Rime buffer (packetbuf) management
#define NULL
The null pointer.
linkaddr_t linkaddr_node_addr
The Rime address of the node.