@@ -431,7 +431,7 @@ programs
431
431
## Timers
432
432
* struct timer
433
433
* Passive timer, only keeps track of its expiration time
434
-
434
+
435
435
* struct etimer
436
436
* Active timer, sends an event when it expires
437
437
@@ -530,15 +530,15 @@ RIME vs IP
530
530
* Communicating nodes must agree on what modules to use on a certain channel
531
531
* Unicast on channel 155
532
532
* Netflood on channel 130
533
- * Channel numbers < 128 are reserved by the system. Used by the shell, other system apps
533
+ * Channel numbers lower than 128 are reserved by the system. Used by the shell, other system apps
534
534
535
535
---
536
536
#### Example 1. Send to Neighbours
537
537
538
538
```
539
539
void recv(struct broadcast_conn * c) {
540
540
printf("Message received %s\n", (char* )packetbuf_dataptr());
541
-  }
541
+ }
542
542
```
543
543
544
544
```
@@ -551,34 +551,41 @@ void setup_sending_a_message_to_all_neighbors(void) {
551
551
broadcast_open(&c, 128, &cb); /* Channel 128 * /
552
552
}
553
553
```
554
+
554
555
```
555
556
void send_message_to_neighbours(char* msg, int len) {
556
557
packetbuf_copyfrom(msg, len); /* Copy data to buffer * /
557
558
broadcast_send(&c);
558
559
}
559
560
```
561
+
560
562
---
561
563
#### Example 2. Send message to entire network
564
+
562
565
```
563
566
void recv(struct trickle_conn * c) { /* callback * /
564
567
printf(“Message received, length = %d\n", databuf_datalen());
565
568
}
566
569
```
570
+
567
571
```
568
572
struct trickle_callbacks cb = {recv}; /* Callbacks * /
569
573
struct trickle_conn c; /* Connection * /
570
574
```
575
+
571
576
```
572
577
void setup_sending_a_message_to_network(void) {
573
578
trickle_open(&c, CLOCK_SECOND, 129, &cb); /* Channel 129 * /
574
579
}
575
580
```
581
+
576
582
```
577
583
void send_message_to_network(char * msg, int len) {
578
584
packetbuf_copyfrom(msg, len); /* Setup rimebuf * /
579
585
trickle_send(&c);
580
586
}
581
587
```
588
+
582
589
---
583
590
## Additional Information I
584
591
@@ -622,4 +629,4 @@ Other stuff
622
629
| ------------- |---------------| ----- |
623
630
| col 3 is | right-aligned | $1600 |
624
631
| col 2 is | centered | $12 |
625
- | zebra stripes | are neat | $1 |
632
+ | zebra stripes | are neat | $1 |
0 commit comments