Microchip® Advanced Software Framework

udp-unicast-receiver.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 "net/ip/uip-debug.h"
#include "simple-udp.h"
#include "servreg-hack.h"
#include "net/rpl/rpl.h"
#include <stdio.h>
#include <string.h>

Macros

#define _DEBUG_   0
 
#define SEND_INTERVAL   (10 * CLOCK_SECOND)
 
#define SEND_TIME   (random_rand() % (SEND_INTERVAL))
 
#define SERVICE_ID   190
 
#define UDP_PORT   1234
 

Functions

static void create_rpl_dag (uip_ipaddr_t *ipaddr)
 
 PROCESS (unicast_receiver_process,"Unicast receiver example process")
 
 PROCESS_THREAD (unicast_receiver_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)
 
static uip_ipaddr_tset_global_address (void)
 

Variables

static struct simple_udp_connection unicast_connection
 
AUTOSTART_PROCESSESunicast_receiver_process
 

#define _DEBUG_   0
#define SEND_INTERVAL   (10 * CLOCK_SECOND)
#define SEND_TIME   (random_rand() % (SEND_INTERVAL))
#define SERVICE_ID   190

Referenced by PROCESS_THREAD().

#define UDP_PORT   1234

Referenced by PROCESS_THREAD().

static void create_rpl_dag ( uip_ipaddr_t ipaddr)
static
PROCESS ( unicast_receiver_process  ,
"Unicast receiver 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 uip_debug_ipaddr_print().

Referenced by PROCESS_THREAD().

struct simple_udp_connection unicast_connection
static

Referenced by PROCESS_THREAD().

AUTOSTART_PROCESSES& unicast_receiver_process