Skip to content

Commit

Permalink
Simple UDP examples and bcast binary
Browse files Browse the repository at this point in the history
  • Loading branch information
alignan committed Nov 13, 2015
1 parent 3a6ccca commit 013709b
Show file tree
Hide file tree
Showing 6 changed files with 2,562 additions and 39 deletions.
20 changes: 0 additions & 20 deletions examples/ipv6/rpl-udp/udp-client.c
Expand Up @@ -34,9 +34,6 @@
#include "net/ipv6/uip-ds6.h"
#include "net/ip/uip-udp-packet.h"
#include "sys/ctimer.h"
#ifdef WITH_COMPOWER
#include "powertrace.h"
#endif
#include <stdio.h>
#include <string.h>

Expand Down Expand Up @@ -141,9 +138,6 @@ PROCESS_THREAD(udp_client_process, ev, data)
{
static struct etimer periodic;
static struct ctimer backoff_timer;
#if WITH_COMPOWER
static int print = 0;
#endif

PROCESS_BEGIN();

Expand All @@ -168,10 +162,6 @@ PROCESS_THREAD(udp_client_process, ev, data)
PRINTF(" local/remote port %u/%u\n",
UIP_HTONS(client_conn->lport), UIP_HTONS(client_conn->rport));

#if WITH_COMPOWER
powertrace_sniff(POWERTRACE_ON);
#endif

etimer_set(&periodic, SEND_INTERVAL);
while(1) {
PROCESS_YIELD();
Expand All @@ -182,16 +172,6 @@ PROCESS_THREAD(udp_client_process, ev, data)
if(etimer_expired(&periodic)) {
etimer_reset(&periodic);
ctimer_set(&backoff_timer, SEND_TIME, send_packet, NULL);

#if WITH_COMPOWER
if (print == 0) {
powertrace_print("#P");
}
if (++print == 3) {
print = 0;
}
#endif

}
}

Expand Down
12 changes: 1 addition & 11 deletions examples/ipv6/rpl-udp/udp-server.c
Expand Up @@ -109,27 +109,17 @@ PROCESS_THREAD(udp_server_process, ev, data)

PRINTF("UDP server started\n");

#if UIP_CONF_ROUTER
/* The choice of server address determines its 6LoPAN header compression.
* Obviously the choice made here must also be selected in udp-client.c.
*
* For correct Wireshark decoding using a sniffer, add the /64 prefix to the 6LowPAN protocol preferences,
* e.g. set Context 0 to aaaa::. At present Wireshark copies Context/128 and then overwrites it.
* (Setting Context 0 to aaaa::1111:2222:3333:4444 will report a 16 bit compressed address of aaaa::1111:22ff:fe33:xxxx)
* Note Wireshark's IPCMV6 checksum verification depends on the correct uncompressed addresses.
* Mode 3 - derived from link local (MAC) address
*/

#if 0
/* Mode 1 - 64 bits inline */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 1);
#elif 1
/* Mode 2 - 16 bits inline */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0x00ff, 0xfe00, 1);
#else
/* Mode 3 - derived from link local (MAC) address */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
#endif

uip_ds6_addr_add(&ipaddr, 0, ADDR_MANUAL);
root_if = uip_ds6_addr_lookup(&ipaddr);
Expand Down

0 comments on commit 013709b

Please sign in to comment.