Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
contiki-ng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NATAF Emmanuel
contiki-ng
Commits
7faeb1fa
Commit
7faeb1fa
authored
13 years ago
by
Adam Dunkels
Browse files
Options
Downloads
Patches
Plain Diff
Updated to use latest Rime APIs
parent
e472c6ea
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/rime/example-multihop.c
+10
-7
10 additions, 7 deletions
examples/rime/example-multihop.c
with
10 additions
and
7 deletions
examples/rime/example-multihop.c
+
10
−
7
View file @
7faeb1fa
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment