Skip to content
Snippets Groups Projects
Commit 7faeb1fa authored by Adam Dunkels's avatar Adam Dunkels
Browse files

Updated to use latest Rime APIs

parent e472c6ea
No related branches found
No related tags found
No related merge requests found
...@@ -120,11 +120,12 @@ remove_neighbor(void *n) ...@@ -120,11 +120,12 @@ remove_neighbor(void *n)
* neighbor table. * neighbor table.
*/ */
static void static void
received_announcement(struct announcement *a, rimeaddr_t *from, received_announcement(struct announcement *a,
const rimeaddr_t *from,
uint16_t id, uint16_t value) uint16_t id, uint16_t value)
{ {
struct example_neighbor *e; struct example_neighbor *e;
/* printf("Got announcement from %d.%d, id %d, value %d\n", /* printf("Got announcement from %d.%d, id %d, value %d\n",
from->u8[0], from->u8[1], id, value);*/ from->u8[0], from->u8[1], id, value);*/
...@@ -216,9 +217,11 @@ PROCESS_THREAD(example_multihop_process, ev, data) ...@@ -216,9 +217,11 @@ PROCESS_THREAD(example_multihop_process, ev, data)
Rime channel we use to open the multihop connection above. */ Rime channel we use to open the multihop connection above. */
announcement_register(&example_announcement, announcement_register(&example_announcement,
CHANNEL, CHANNEL,
0,
received_announcement); received_announcement);
/* Set a dummy value to start sending out announcments. */
announcement_set_value(&example_announcement, 0);
/* Activate the button sensor. We use the button to drive traffic - /* Activate the button sensor. We use the button to drive traffic -
when the button is pressed, a packet is sent. */ when the button is pressed, a packet is sent. */
SENSORS_ACTIVATE(button_sensor); SENSORS_ACTIVATE(button_sensor);
...@@ -235,11 +238,11 @@ PROCESS_THREAD(example_multihop_process, ev, data) ...@@ -235,11 +238,11 @@ PROCESS_THREAD(example_multihop_process, ev, data)
packetbuf_copyfrom("Hello", 6); packetbuf_copyfrom("Hello", 6);
/* Set the Rime address of the final receiver of the packet to /* Set the Rime address of the final receiver of the packet to
1.1. This is just a dummy value that happens to work nicely in a 1.0. This is a value that happens to work nicely in a Cooja
netsim simulation (because the default simulation setup creates simulation (because the default simulation setup creates one
one node with address 1.1). */ node with address 1.0). */
to.u8[0] = 1; to.u8[0] = 1;
to.u8[1] = 1; to.u8[1] = 0;
/* Send the packet. */ /* Send the packet. */
multihop_send(&multihop, &to); multihop_send(&multihop, &to);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment