67 #if CONTIKI_TARGET_COOJA 68 #include "lib/simEnvChange.h" 69 #include "sys/cooja_mt.h" 75 #if CONTIKI_TARGET_COOJA 76 #define BUSYWAIT_UNTIL_ABS(cond, t0, offset) \ 77 while(!(cond) && RTIMER_CLOCK_LT(RTIMER_NOW(), (t0) + (offset))) { \ 78 simProcessRunValue = 1; \ 82 #define BUSYWAIT_UNTIL_ABS(cond, t0, offset) \ 83 while(!(cond) && RTIMER_CLOCK_LT(RTIMER_NOW(), (t0) + (offset))) ; 91 #ifndef TSCH_CALLBACK_JOINING_NETWORK 92 #define TSCH_CALLBACK_JOINING_NETWORK tsch_rpl_callback_joining_network 95 #ifndef TSCH_CALLBACK_LEAVING_NETWORK 96 #define TSCH_CALLBACK_LEAVING_NETWORK tsch_rpl_callback_leaving_network 99 #ifndef TSCH_CALLBACK_KA_SENT 100 #define TSCH_CALLBACK_KA_SENT tsch_rpl_callback_ka_sent 105 #if BUILD_WITH_ORCHESTRA 107 #ifndef TSCH_CALLBACK_NEW_TIME_SOURCE 108 #define TSCH_CALLBACK_NEW_TIME_SOURCE orchestra_callback_new_time_source 111 #ifndef TSCH_CALLBACK_PACKET_READY 112 #define TSCH_CALLBACK_PACKET_READY orchestra_callback_packet_ready 118 #ifdef TSCH_CALLBACK_JOINING_NETWORK 119 void TSCH_CALLBACK_JOINING_NETWORK();
123 #ifdef TSCH_CALLBACK_LEAVING_NETWORK 124 void TSCH_CALLBACK_LEAVING_NETWORK();
128 #ifdef TSCH_CALLBACK_KA_SENT 129 void TSCH_CALLBACK_KA_SENT();
134 #ifdef TSCH_CALLBACK_DO_NACK 135 int TSCH_CALLBACK_DO_NACK(
struct tsch_link *link, linkaddr_t *src, linkaddr_t *dst);
139 #ifdef TSCH_CALLBACK_NEW_TIME_SOURCE 145 #ifdef TSCH_CALLBACK_PACKET_READY 146 void TSCH_CALLBACK_PACKET_READY(
void);
152 extern int tsch_is_coordinator;
154 extern int tsch_is_associated;
156 extern int tsch_is_pan_secured;
158 extern const struct mac_driver tschmac_driver;
160 extern const linkaddr_t tsch_broadcast_address;
162 extern const linkaddr_t tsch_eb_address;
165 extern uint8_t tsch_join_priority;
168 extern uint8_t tsch_current_channel;
170 extern uint8_t tsch_hopping_sequence[TSCH_HOPPING_SEQUENCE_MAX_LEN];
173 extern rtimer_clock_t tsch_timing[tsch_ts_elements_count];
175 extern unsigned long tx_count;
176 extern unsigned long rx_count;
177 extern unsigned long sync_count;
The structure of a MAC protocol driver in Contiki.
void tsch_set_join_priority(uint8_t jp)
Set the TSCH join priority (JP)
Header file for the link-layer address representation
TSCH neighbor information.
void tsch_set_ka_timeout(uint32_t timeout)
Set the desynchronization timeout after which a node sends a unicasst keep-alive (KA) to its time sou...
void tsch_schedule_keepalive_immediately(void)
Schedule a keep-alive immediately.
TSCH runtime operation within timeslots.
void tsch_schedule_keepalive(void)
Schedule a keep-alive transmission within [timeout*0.9, timeout[.
For quick modulo operation on ASN.
void tsch_set_eb_period(uint32_t period)
Set the period at wich TSCH enhanced beacons (EBs) are sent.
#define PROCESS_NAME(name)
Declare the name of a process.
TSCH adaptive time synchronization.
void tsch_disassociate(void)
Leave the TSCH network we are currently in.
void tsch_set_pan_secured(int enable)
Enable/disable security.
An IEEE 802.15.4-2015 TSCH link (also called cell or slot)
TSCH packet parsing and creation.
The ASN is an absolute slot number over 5 bytes.
void tsch_set_coordinator(int enable)
Set the node as PAN coordinator.