48static uint16_t slotframe_handle = 0;
53get_node_timeslot(
const linkaddr_t *
addr)
55 if(
addr != NULL && ORCHESTRA_UNICAST_PERIOD > 0) {
56 return ORCHESTRA_LINKADDR_HASH(
addr) % ORCHESTRA_UNICAST_PERIOD;
63get_node_channel_offset(
const linkaddr_t *
addr)
65 if(
addr != NULL && ORCHESTRA_UNICAST_MAX_CHANNEL_OFFSET >= ORCHESTRA_UNICAST_MIN_CHANNEL_OFFSET) {
66 return ORCHESTRA_LINKADDR_HASH(
addr) % (ORCHESTRA_UNICAST_MAX_CHANNEL_OFFSET - ORCHESTRA_UNICAST_MIN_CHANNEL_OFFSET + 1)
67 + ORCHESTRA_UNICAST_MIN_CHANNEL_OFFSET;
74add_uc_link(
const linkaddr_t *linkaddr)
76 if(linkaddr != NULL) {
77 uint16_t timeslot = get_node_timeslot(linkaddr);
83 LINK_OPTION_SHARED | LINK_OPTION_TX,
84 LINK_TYPE_NORMAL, &tsch_broadcast_address,
90remove_uc_link(
const linkaddr_t *linkaddr)
92 if(linkaddr != NULL) {
93 uint16_t timeslot = get_node_timeslot(linkaddr);
100neighbor_updated(
const linkaddr_t *linkaddr, uint8_t is_added)
103 add_uc_link(linkaddr);
105 remove_uc_link(linkaddr);
110select_packet(uint16_t *slotframe, uint16_t *timeslot, uint16_t *channel_offset)
113 const linkaddr_t *dest = packetbuf_addr(PACKETBUF_ADDR_RECEIVER);
114 if(packetbuf_attr(PACKETBUF_ATTR_FRAME_TYPE) == FRAME802154_DATAFRAME
115 && !orchestra_is_root_schedule_active(dest)
117 if(slotframe != NULL) {
118 *slotframe = slotframe_handle;
120 if(timeslot != NULL) {
121 *timeslot = get_node_timeslot(dest);
124 if(channel_offset != NULL) {
125 *channel_offset = get_node_channel_offset(dest);
138 remove_uc_link(old_addr);
139 add_uc_link(new_addr);
144init(uint16_t sf_handle)
146 uint16_t rx_timeslot;
149 slotframe_handle = sf_handle;
152 rx_timeslot = get_node_timeslot(local_addr);
156 LINK_TYPE_NORMAL, &tsch_broadcast_address,
157 rx_timeslot, get_node_channel_offset(local_addr), 1);
160struct orchestra_rule unicast_per_neighbor_rpl_ns = {
168 "unicast per neighbor non-storing",
169 ORCHESTRA_UNICAST_PERIOD,
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
bool linkaddr_cmp(const linkaddr_t *addr1, const linkaddr_t *addr2)
Compare two link-layer addresses.
const linkaddr_t linkaddr_null
The null link-layer address.
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.
int tsch_schedule_remove_link_by_offsets(struct tsch_slotframe *slotframe, uint16_t timeslot, uint16_t channel_offset)
Removes a link from a slotframe and timeslot + channel offset.
void tsch_queue_free_packets_to(const linkaddr_t *addr)
Flush packets to a specific address.
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.
Header file for the Packet buffer (packetbuf) management.
TSCH neighbor information.
802.15.4e slotframe (contains links)
Header file for routing table manipulation.
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.