Merge branch 'develop' into contrib/default-prefix-as-variable

This commit is contained in:
Simon Duquennoy 2019-02-19 08:57:01 +01:00 committed by GitHub
commit 3e91b32182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 17 deletions

View File

@ -136,5 +136,13 @@ tsch_rpl_callback_parent_switch(rpl_parent_t *old, rpl_parent_t *new)
rpl_parent_get_ipaddr(new)));
}
}
/*---------------------------------------------------------------------------*/
/* Check RPL has joined DODAG.
* To use, set #define TSCH_RPL_CHECK_DODAG_JOINED tsch_rpl_check_dodag_joined */
int
tsch_rpl_check_dodag_joined(void)
{
return NETSTACK_ROUTING.node_has_joined();
}
#endif /* UIP_CONF_IPV6_RPL */
/** @} */

View File

@ -79,6 +79,12 @@ void tsch_rpl_callback_new_dio_interval(clock_time_t dio_interval);
* \param new The new RPL parent
*/
void tsch_rpl_callback_parent_switch(rpl_parent_t *old, rpl_parent_t *new);
/**
* \brief Check RPL has joined DODAG.
* To use, set TSCH_RPL_CHECK_DODAG_JOINED tsch_rpl_check_dodag_joined
* \return 1 if joined, 0 otherwise
*/
int tsch_rpl_check_dodag_joined(void);
#endif /* __TSCH_RPL_H__ */
/** @} */

View File

@ -861,7 +861,12 @@ PROCESS_THREAD(tsch_send_eb_process, ev, data)
while(1) {
unsigned long delay;
if(tsch_is_associated && tsch_current_eb_period > 0) {
if(tsch_is_associated && tsch_current_eb_period > 0
#ifdef TSCH_RPL_CHECK_DODAG_JOINED
/* Implementation section 6.3 of RFC 8180 */
&& TSCH_RPL_CHECK_DODAG_JOINED()
#endif /* TSCH_RPL_CHECK_DODAG_JOINED */
) {
/* Enqueue EB only if there isn't already one in queue */
if(tsch_queue_packet_count(&tsch_eb_address) == 0) {
uint8_t hdr_len = 0;

View File

@ -88,6 +88,10 @@ frequency hopping for enhanced reliability.
#define TSCH_CALLBACK_KA_SENT tsch_rpl_callback_ka_sent
#endif /* TSCH_CALLBACK_KA_SENT */
#ifndef TSCH_RPL_CHECK_DODAG_JOINED
#define TSCH_RPL_CHECK_DODAG_JOINED tsch_rpl_check_dodag_joined
#endif /* TSCH_RPL_CHECK_DODAG_JOINED */
#endif /* UIP_CONF_IPV6_RPL */
#if BUILD_WITH_ORCHESTRA
@ -117,6 +121,11 @@ void TSCH_CALLBACK_LEAVING_NETWORK();
void TSCH_CALLBACK_KA_SENT();
#endif
/* Called by TSCH before sending a EB */
#ifdef TSCH_RPL_CHECK_DODAG_JOINED
int TSCH_RPL_CHECK_DODAG_JOINED();
#endif
/* Called by TSCH form interrupt after receiving a frame, enabled upper-layer to decide
* whether to ACK or NACK */
#ifdef TSCH_CALLBACK_DO_NACK

View File

@ -7,7 +7,7 @@
<project EXPORT="discard">[APPS_DIR]/powertracker</project>
<simulation>
<title>RPL+TSCH (Z1)</title>
<randomseed>123456</randomseed>
<randomseed>1</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
org.contikios.cooja.radiomediums.UDGM
@ -108,20 +108,6 @@
</interface_config>
<motetype_identifier>z11</motetype_identifier>
</mote>
<mote>
<breakpoints />
<interface_config>
org.contikios.cooja.interfaces.Position
<x>10.622284947035123</x>
<y>109.81862399725188</y>
<z>0.0</z>
</interface_config>
<interface_config>
org.contikios.cooja.mspmote.interfaces.MspMoteID
<id>6</id>
</interface_config>
<motetype_identifier>z11</motetype_identifier>
</mote>
</simulation>
<plugin>
org.contikios.cooja.plugins.SimControl
@ -168,7 +154,6 @@
<mote>2</mote>
<mote>3</mote>
<mote>4</mote>
<mote>5</mote>
<showRadioRXTX />
<showRadioHW />
<showLEDs />