TSCH burst mode: bounded burst lengths

This commit is contained in:
Simon Duquennoy 2018-03-26 11:35:35 -07:00
parent d3b8b80b28
commit 3fe846dbad
3 changed files with 12 additions and 4 deletions

View File

@ -318,10 +318,17 @@
#endif
/* Add burst mode to 6TiSCH minimal schedule */
#ifdef TSCH_SCHEDULE_CONF_WITH_6TISCH_MINIMAL_WITH_BURST
#define TSCH_SCHEDULE_WITH_6TISCH_MINIMAL_WITH_BURST TSCH_SCHEDULE_CONF_WITH_6TISCH_MINIMAL_WITH_BURST
#ifdef TSCH_CONF_WITH_6TISCH_MINIMAL_WITH_BURST
#define TSCH_WITH_6TISCH_MINIMAL_WITH_BURST TSCH_CONF_WITH_6TISCH_MINIMAL_WITH_BURST
#else
#define TSCH_SCHEDULE_WITH_6TISCH_MINIMAL_WITH_BURST 0
#define TSCH_WITH_6TISCH_MINIMAL_WITH_BURST 0
#endif
/* Set an upper bound on burst length */
#ifdef TSCH_CONF_BURST_MAX_LEN
#define TSCH_BURST_MAX_LEN TSCH_CONF_BURST_MAX_LEN
#else
#define TSCH_BURST_MAX_LEN 32
#endif
/* 6TiSCH Minimal schedule slotframe length */

View File

@ -424,7 +424,7 @@ tsch_schedule_create_minimal(void)
* Timeslot: 0, channel offset: 0. */
tsch_schedule_add_link(sf_min,
LINK_OPTION_RX | LINK_OPTION_TX | LINK_OPTION_SHARED | LINK_OPTION_TIME_KEEPING
| (TSCH_SCHEDULE_WITH_6TISCH_MINIMAL_WITH_BURST ? LINK_OPTION_BURST : 0),
| (TSCH_WITH_6TISCH_MINIMAL_WITH_BURST ? LINK_OPTION_BURST : 0),
LINK_TYPE_ADVERTISING, &tsch_broadcast_address,
0, 0);
}

View File

@ -476,6 +476,7 @@ PT_THREAD(tsch_tx_slot(struct pt *pt, struct rtimer *t))
/* Unicast. More packets in queue for the neighbor? */
burst_link_requested = 0;
if(!is_broadcast && (current_link->link_options & LINK_OPTION_BURST)
&& tsch_current_burst_count + 1 < TSCH_BURST_MAX_LEN
&& tsch_queue_packet_count(&current_neighbor->addr) > 1) {
burst_link_requested = 1;
tsch_packet_set_frame_pending(packet, packet_len);