2017-07-31 13:26:29 +02:00
|
|
|
/*
|
|
|
|
* Gardena 9V Magnet-Valve
|
|
|
|
* We have a CoAP Resource for the Valve, it can be in state 1 (on) and
|
|
|
|
* 0 (off).
|
|
|
|
* Transition on-off outputs a negative pulse
|
|
|
|
* Transition off-on outputs a positive pulse
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "contiki.h"
|
|
|
|
#include "contiki-net.h"
|
|
|
|
#include "er-coap.h"
|
2017-08-20 11:47:13 +02:00
|
|
|
#include "resources.h"
|
2017-07-31 13:26:29 +02:00
|
|
|
char resname[] = "update";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void setup (void)
|
|
|
|
{
|
|
|
|
rest_init_engine ();
|
|
|
|
rest_activate_resource (&res_upload_image, resname);
|
2017-08-20 11:47:13 +02:00
|
|
|
rest_activate_resource (&res_part_count, (char *)"part_count");
|
|
|
|
rest_activate_resource (&res_part_size, (char *)"part_size");
|
|
|
|
rest_activate_resource (&res_boot_default, (char *)"boot_default");
|
|
|
|
rest_activate_resource (&res_boot_next, (char *)"boot_next");
|
2017-08-22 20:20:07 +02:00
|
|
|
rest_activate_resource (&res_active_part, (char *)"active_part");
|
2017-08-20 15:01:30 +02:00
|
|
|
rest_activate_resource (&res_part_start, (char *)"part_start");
|
|
|
|
rest_activate_resource (&res_part_ok, (char *)"part_ok");
|
2017-07-31 13:26:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void loop (void)
|
|
|
|
{
|
2017-08-20 19:42:42 +02:00
|
|
|
printf ("Hello\n");
|
2017-07-31 13:26:29 +02:00
|
|
|
}
|