#include "contiki-net.h"
#include "net/ip/simple-udp.h"
#include "network-reboot.h"
#include "dev/leds.h"
#include "dev/watchdog.h"
#include <string.h>
#include <stdio.h>
Data Structures | |
struct | network_reboot_msg |
Macros | |
#define | SEND_INTERVAL (20 * CLOCK_SECOND) |
#define | SEND_TIME (random_rand() % (SEND_INTERVAL)) |
#define | STARTUP_GRACE_PERIOD (120 * CLOCK_SECOND) |
#define | UDP_PORT 31337 |
Functions | |
void | network_reboot_init (void) |
void | network_reboot_reboot (int seconds) |
PROCESS (network_reboot_process,"network_reboot process") | |
PROCESS_THREAD (network_reboot_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 void | send_msg (struct simple_udp_connection *conn, int seconds) |
Variables | |
static struct simple_udp_connection | broadcast_connection |
static const char | magic_bytes [6] = "Reboot" |
static int | seconds_until_reboot |
#define SEND_INTERVAL (20 * CLOCK_SECOND) |
Referenced by PROCESS_THREAD().
#define SEND_TIME (random_rand() % (SEND_INTERVAL)) |
Referenced by PROCESS_THREAD().
#define STARTUP_GRACE_PERIOD (120 * CLOCK_SECOND) |
Referenced by PROCESS_THREAD().
#define UDP_PORT 31337 |
Referenced by PROCESS_THREAD().
void network_reboot_init | ( | void | ) |
References network_reboot_process, NULL, and process_start().
void network_reboot_reboot | ( | int | seconds | ) |
References broadcast_connection, seconds, seconds_until_reboot, and send_msg().
PROCESS | ( | network_reboot_process | , |
"network_reboot process" | |||
) |
PROCESS_THREAD | ( | network_reboot_process | , |
ev | , | ||
data | |||
) |
References broadcast_connection, CLOCK_SECOND, data, etimer_expired(), etimer_reset(), etimer_set(), LEDS_ALL, leds_toggle(), NULL, printf, PROCESS_BEGIN, PROCESS_END, PROCESS_WAIT_EVENT, PROCESS_WAIT_EVENT_UNTIL, receiver(), seconds_until_reboot, SEND_INTERVAL, send_msg(), SEND_TIME, simple_udp_register(), STARTUP_GRACE_PERIOD, and UDP_PORT.
|
static |
References network_reboot_msg::magic_bytes, magic_bytes, network_reboot_msg::seconds, seconds_until_reboot, and uip_htons().
Referenced by PROCESS_THREAD().
|
static |
References addr, network_reboot_msg::magic_bytes, magic_bytes, network_reboot_msg::seconds, seconds_until_reboot, simple_udp_sendto(), uip_create_linklocal_allnodes_mcast, and uip_htons().
Referenced by network_reboot_reboot(), and PROCESS_THREAD().
|
static |
Referenced by network_reboot_reboot(), and PROCESS_THREAD().
|
static |
Referenced by receiver(), and send_msg().
|
static |
Referenced by network_reboot_reboot(), PROCESS_THREAD(), receiver(), and send_msg().