Contiki 3.x
z1-coap.c
Go to the documentation of this file.
1 /**
2  * \file
3  * Sampler for the mountain-sensing platform.
4  *
5  * This intializes the store, and starts the er_server, and the sampler.
6  *
7  * \author
8  * Dan Playle <djap1g12@soton.ac.uk>
9  * Philip Basford <pjb@ecs.soton.ac.uk>
10  * Graeme Bragg <gmb1g08@ecs.soton.ac.uk>
11  * Tyler Ward <tw16g08@ecs.soton.ac.uk>
12  * Kirk Martinez <km@ecs.soton.ac.uk>
13  * Arthur Fabre <af1g12@ecs.soton.ac.uk>
14  */
15 
16 #include "contiki.h"
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include "z1-coap.h"
20 #include "contiki-conf.h"
21 
22 #include "store.h"
23 #include "sampler.h"
24 #include "er-server.h"
25 
26 PROCESS(feshie_sense_process, "Feshie Sense");
27 
28 AUTOSTART_PROCESSES(&feshie_sense_process);
29 
30 PROCESS_THREAD(feshie_sense_process, ev, data) {
31  PROCESS_BEGIN();
32 
33  // Initialize the store before anything els
34  store_init();
35 
36  process_start(&sample_process, NULL);
37 
38  er_server_init();
39 
40  PROCESS_END();
41 }
#define PROCESS_END()
Define the end of a process.
Definition: process.h:131
#define PROCESS(name, strname)
Declare a process.
Definition: process.h:307
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
Definition: process.h:273
#define NULL
The null pointer.
Convenience layer for storing readings and the config.
void store_init(void)
Initialize the data store.
Definition: store.c:339
void process_start(struct process *p, process_data_t data)
Start a process.
Definition: process.c:99
Process that periodically takes samples from onboard sensors and stores them in flash.
#define PROCESS_BEGIN()
Define the beginning of a process.
Definition: process.h:120