Microchip® Advanced Software Framework

broadcast-example.c File Reference
#include "contiki.h"
#include "lib/random.h"
#include "sys/ctimer.h"
#include "sys/etimer.h"
#include "net/ip/uip.h"
#include "net/ipv6/uip-ds6.h"
#include "sys/energest.h"
#include "simple-udp.h"
#include "sys/compower.h"
#include <stdio.h>
#include <string.h>

Macros

#define SEND_INTERVAL   (5 * CLOCK_SECOND)
 
#define SEND_TIME   (random_rand() % (SEND_INTERVAL))
 
#define UDP_PORT   1234
 

Functions

 PROCESS (broadcast_example_process,"UDP broadcast example process")
 
 PROCESS_THREAD (broadcast_example_process, ev, data)
 
static void receiver (struct simple_udp_connection *c, const uip_ipaddr_t *sender_addr, uint16_t sender_port, const uip_ipaddr_t *receiver_addr, uint16_t receiver_port, const uint8_t *data, uint16_t datalen)
 

Variables

static struct simple_udp_connection broadcast_connection
 
AUTOSTART_PROCESSESbroadcast_example_process
 
static uip_ds6_addr_tlladdr
 
static uint16_t mynodeid
 

#define SEND_INTERVAL   (5 * CLOCK_SECOND)

Referenced by PROCESS_THREAD().

#define SEND_TIME   (random_rand() % (SEND_INTERVAL))
#define UDP_PORT   1234

Referenced by PROCESS_THREAD().

PROCESS ( broadcast_example_process  ,
"UDP broadcast example process  
)
static void receiver ( struct simple_udp_connection c,
const uip_ipaddr_t sender_addr,
uint16_t  sender_port,
const uip_ipaddr_t receiver_addr,
uint16_t  receiver_port,
const uint8_t *  data,
uint16_t  datalen 
)
static

References printf, and sent_packets.

Referenced by do_event(), PROCESS_THREAD(), and uip_over_mesh_send().

struct simple_udp_connection broadcast_connection
static

Referenced by PROCESS_THREAD().

AUTOSTART_PROCESSES& broadcast_example_process
uint16_t mynodeid
static

Referenced by PROCESS_THREAD().