43static uint16_t slotframe_handle = 0;
44static uint16_t channel_offset = 0;
50get_node_timeslot(
const linkaddr_t *
addr)
52#if ORCHESTRA_EBSF_PERIOD > 0
53 return ORCHESTRA_LINKADDR_HASH(
addr) % ORCHESTRA_EBSF_PERIOD;
60get_node_channel_offset(
const linkaddr_t *
addr)
62#if ORCHESTRA_EBSF_PERIOD > 0
63 if(ORCHESTRA_EB_MAX_CHANNEL_OFFSET >= ORCHESTRA_EB_MIN_CHANNEL_OFFSET) {
64 return ORCHESTRA_LINKADDR_HASH(
addr) %
65 (ORCHESTRA_EB_MAX_CHANNEL_OFFSET - ORCHESTRA_EB_MIN_CHANNEL_OFFSET + 1)
66 + ORCHESTRA_EB_MIN_CHANNEL_OFFSET;
77select_packet(uint16_t *slotframe, uint16_t *timeslot, uint16_t *channel_offset)
80 if(packetbuf_attr(PACKETBUF_ATTR_FRAME_TYPE) == FRAME802154_BEACONFRAME) {
81 if(slotframe != NULL) {
82 *slotframe = slotframe_handle;
84 if(timeslot != NULL) {
96 uint16_t old_ts = 0xffff;
97 uint16_t new_ts = 0xffff;
98 uint16_t old_channel_offset = 0xffff;
99 uint16_t new_channel_offset = 0xffff;
103 old_ts = get_node_timeslot(
addr);
104 old_channel_offset = get_node_channel_offset(
addr);
109 new_ts = get_node_timeslot(
addr);
110 new_channel_offset = get_node_channel_offset(
addr);
113 if(new_ts == old_ts && old_channel_offset == new_channel_offset) {
117 if(timesource_link != NULL) {
120 timesource_link = NULL;
122 if(new_ts != 0xffff) {
125 &tsch_broadcast_address, new_ts, new_channel_offset, 0);
130init(uint16_t sf_handle)
134 slotframe_handle = sf_handle;
135 channel_offset = sf_handle;
140 LINK_TYPE_ADVERTISING_ONLY, &tsch_broadcast_address,
141 local_ts, local_channel_offset, 0);
144struct orchestra_rule eb_per_time_source = {
152 "EB per time source",
153 ORCHESTRA_EBSF_PERIOD,
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
struct tsch_link * tsch_schedule_add_link(struct tsch_slotframe *slotframe, uint8_t link_options, enum link_type link_type, const linkaddr_t *address, uint16_t timeslot, uint16_t channel_offset, uint8_t do_remove)
Adds a link to a slotframe.
struct tsch_slotframe * tsch_schedule_add_slotframe(uint16_t handle, uint16_t size)
Creates and adds a new slotframe.
linkaddr_t * tsch_queue_get_nbr_address(const struct tsch_neighbor *n)
Get the address of a neighbor.
int tsch_schedule_remove_link(struct tsch_slotframe *slotframe, struct tsch_link *l)
Removes a link.
Header file for the Packet buffer (packetbuf) management.
An IEEE 802.15.4-2015 TSCH link (also called cell or slot)
TSCH neighbor information.
802.15.4e slotframe (contains links)
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.