Updated to use latest Rime APIs

This commit is contained in:
Adam Dunkels 2011-09-05 22:38:23 +02:00
parent e472c6ea97
commit 7faeb1fa3d

View File

@ -120,7 +120,8 @@ 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;
@ -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)
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);