49 #include PLATFORM_HEADER
60 #include "dev/watchdog.h"
62 #include "dev/button-sensor.h"
63 #include "dev/temperature-sensor.h"
64 #include "dev/acc-sensor.h"
66 #include "dev/uart1.h"
75 #if NETSTACK_CONF_WITH_IPV6
79 #define DEBUG DEBUG_PRINT
82 #if NETSTACK_CONF_WITH_IPV6
83 PROCINIT(&tcpip_process, &sensors_process);
85 PROCINIT(&sensors_process);
86 #warning "No TCP/IP process!"
89 SENSORS(&
button_sensor, &temperature_sensor, &acc_sensor, &contact_sensor);
93 #define DEFAULT_RADIO_CCA_THRESHOLD -77
109 for(c = 0; c < 8; c++) {
110 eui64.u8[c] = stm32w_eui64[7 - c];
114 #if NETSTACK_CONF_WITH_IPV6
118 #if NETSTACK_CONF_WITH_IPV6
124 printf(
"Rime started with address ");
125 for(i = 0; i <
sizeof(linkaddr_t) - 1; i++) {
148 PRINTF(
"\r\nStarting ");
149 PRINTF(CONTIKI_VERSION_STRING);
150 PRINTF(
" on %s\r\n", boardDescription->name);
151 boardPrintStringDescription();
161 #if WITH_SERIAL_LINE_INPUT
176 printf(
"%s %s, channel check rate %d Hz\n",
177 NETSTACK_MAC.name, NETSTACK_RDC.name,
178 CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1:
179 NETSTACK_RDC.channel_check_interval()));
180 printf(
"802.15.4 PAN ID 0x%x, EUI-%d:",
183 printf(
", radio channel %u\n", RF_CHANNEL);
188 ENERGEST_ON(ENERGEST_TYPE_CPU);
197 ST_RadioSetEdCcaThreshold(DEFAULT_RADIO_CCA_THRESHOLD);
199 autostart_start(autostart_processes);
200 #if NETSTACK_CONF_WITH_IPV6
201 printf(
"Tentative link-local IPv6 address ");
205 lladdr = uip_ds6_get_link_local(-1);
206 for(i = 0; i < 7; ++i) {
207 printf(
"%02x%02x:", lladdr->ipaddr.u8[i * 2],
208 lladdr->ipaddr.u8[i * 2 + 1]);
210 printf(
"%02x%02x\n", lladdr->ipaddr.u8[14], lladdr->ipaddr.u8[15]);
214 if(!UIP_CONF_IPV6_RPL) {
217 uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
220 printf(
"Tentative global IPv6 address ");
221 for(i = 0; i < 7; ++i) {
223 ipaddr.u8[i * 2], ipaddr.u8[i * 2 + 1]);
226 ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
245 ENERGEST_SWITCH(ENERGEST_TYPE_CPU, ENERGEST_TYPE_LPM);
250 ENERGEST_SWITCH(ENERGEST_TYPE_LPM, ENERGEST_TYPE_CPU);
static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
#define INTERRUPTS_ON()
Enable global interrupts without regard to the current or previous state.
void halInit(void)
Initializes microcontroller-specific peripherals.
Generic set of HAL includes for all platforms.
Header file for IPv6-related data structures.
void uart1_init(unsigned long ubr)
Initalize the RS232 port.
Return codes for API functions and module definitions.
void clock_init(void)
Initialize the clock library.
#define IEEE802154_CONF_PANID
Default PAN ID.
STM32W radio driver header file
int process_run(void)
Run the system once - call poll handlers and process one event.
Header file for the Rime address representation
Unicast address structure.
SENSORS & button_sensor
Copyright (c) 2014, Analog Devices, Inc.
Header file for the Rime stack
#define NULL
The null pointer.
Contact magnetic sensor header file.
void linkaddr_set_node_addr(linkaddr_t *t)
Set the address of the current node.
void watchdog_periodic(void)
Writes the WDT clear sequence.
#define ADDR_TENTATIVE
Possible states for the an address (RFC 4862)
#define CLOCK_SECOND
A second, measured in system clock time.
#define uip_ip6addr(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7)
Construct an IPv6 address from eight 16-bit words.
Header for A/D converter.
Header file for the uIP TCP/IP stack.
void process_start(struct process *p, process_data_t data)
Start a process.
int main(void)
This is main...
uip_ds6_addr_t * uip_ds6_addr_add(uip_ipaddr_t *ipaddr, unsigned long vlifetime, uint8_t type)
Add a unicast address to the interface.
void rtimer_init(void)
Initialize the real-time scheduler.
A set of debugging macros for the IP stack
Generic serial I/O process header filer.
CCIF uip_lladdr_t uip_lladdr
Host L2 address.
void process_init(void)
Initialize the process module.
void ctimer_init(void)
Initialize the callback timer library.
linkaddr_t linkaddr_node_addr
The Rime address of the node.
u8 * ST_RadioGetEui64(void)
This function get the EUI 64 of the node.
int serial_line_input_byte(unsigned char c)
Get one byte of input from the serial driver.
void halSleepWithOptions(SleepModes sleepMode, uint32_t gpioWakeBitMask)
Puts the microcontroller to sleep in a specified mode, allows the GPIO wake sources to be determined ...
void watchdog_start(void)
Starts the WDT in watchdog mode if enabled by user configuration, maximum interval.
Include file for the Contiki low-layer network stack (NETSTACK)
void uip_ds6_set_addr_iid(uip_ipaddr_t *ipaddr, uip_lladdr_t *lladdr)
set the last 64 bits of an IP address based on the MAC address