Merge pull request #1950 from yatch/pr/update-for-tsch-cooja-mote

Miscellaneous updates for tsch-cooja-mote
This commit is contained in:
Nicolas Tsiftes 2016-12-05 18:40:28 +01:00 committed by GitHub
commit f09e84976a
3 changed files with 15 additions and 8 deletions

View file

@ -42,6 +42,7 @@ It has been tested on the following platforms:
* Zolertia Zoul (`zoul`, tested on hardware)
* OpenMote-CC2538 (`openmote-cc2538`, tested on hardware)
* CC2650 (`srf06-cc26xx`, tested on hardware)
* Cooja mote (`cooja`, tested with cooja)
This implementation was present at the ETSI Plugtest
event in Prague in July 2015, and did successfully inter-operate with all
@ -83,7 +84,7 @@ Orchestra is implemented in:
A simple TSCH+RPL example is included under `examples/ipv6/rpl-tsch`.
To use TSCH, first make sure your platform supports it.
Currently, `jn516x`, `sky`, `z1`, `cc2538dk`, `zoul`, `openmote-cc2538`, and `srf06-cc26xx` are the supported platforms.
Currently, `jn516x`, `sky`, `z1`, `cc2538dk`, `zoul`, `openmote-cc2538`, `srf06-cc26xx`, and `cooja` are the supported platforms.
To add your own, we refer the reader to the next section.
To add TSCH to your application, first include the TSCH module from your makefile with:
@ -179,7 +180,7 @@ Instead, TSCH will poll the driver for incoming packets, from interrupt, exactly
TSCH will check when initializing (in `tsch_init`) that the radio driver supports all required features, namely:
* get and set Rx mode (`RADIO_PARAM_RX_MODE`) as follows:
* enable address filtering with `RADIO_RX_MODE_ADDRESS_FILTER`
* disable address filtering with `RADIO_RX_MODE_ADDRESS_FILTER`
* disable auto-ack with `RADIO_RX_MODE_AUTOACK`
* enable poll mode with `RADIO_RX_MODE_POLL_MODE`
* get and set Tx mode (`RADIO_PARAM_TX_MODE`) as follows:

View file

@ -170,15 +170,21 @@ PROCESS_THREAD(node_process, ev, data)
static enum { role_6ln, role_6dr, role_6dr_sec } node_role;
node_role = role_6ln;
int coordinator_candidate = 0;
#ifdef CONTIKI_TARGET_Z1
/* Set node with MAC address c1:0c:00:00:00:00:01 as coordinator,
* convenient in cooja for regression tests using z1 nodes
* */
#ifdef CONTIKI_TARGET_Z1
extern unsigned char node_mac[8];
unsigned char coordinator_mac[8] = { 0xc1, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
if(memcmp(node_mac, coordinator_mac, 8) == 0) {
coordinator_candidate = (memcmp(node_mac, coordinator_mac, 8) == 0);
#elif CONTIKI_TARGET_COOJA
coordinator_candidate = (node_id == 1);
#endif
if(coordinator_candidate) {
if(LLSEC802154_ENABLED) {
node_role = role_6dr_sec;
} else {
@ -187,7 +193,6 @@ PROCESS_THREAD(node_process, ev, data)
} else {
node_role = role_6ln;
}
#endif
#if CONFIG_VIA_BUTTON
{

View file

@ -38,8 +38,9 @@
#define RTIMER_ARCH_SECOND UINT64_C(1000000)
#define US_TO_RTIMERTICKS(US) (US)
#define RTIMERTICKS_TO_US(T) (T)
#define US_TO_RTIMERTICKS(US) (US)
#define RTIMERTICKS_TO_US(T) (T)
#define RTIMERTICKS_TO_US_64(T) (T)
rtimer_clock_t rtimer_arch_now(void);
int rtimer_arch_check(void);