From 3af0cc460cfbe732ede639a47ded36630a573695 Mon Sep 17 00:00:00 2001 From: Flo Date: Mon, 22 Aug 2016 22:53:01 +0200 Subject: [PATCH 1/2] set max-age header --- examples/osd/triggerbaord/resources/res-event.c | 3 +++ 1 file changed, 3 insertions(+) mode change 100644 => 100755 examples/osd/triggerbaord/resources/res-event.c diff --git a/examples/osd/triggerbaord/resources/res-event.c b/examples/osd/triggerbaord/resources/res-event.c old mode 100644 new mode 100755 index 8bc68102d..6470c311b --- a/examples/osd/triggerbaord/resources/res-event.c +++ b/examples/osd/triggerbaord/resources/res-event.c @@ -93,6 +93,9 @@ res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferr } /* A post_handler that handles subscriptions/observing will be called for periodic resources by the framework. */ + + // tell client when to schedule re-registration: 1 Hour + REST.set_header_max_age(response, /* uint32_t, Seconds */ 3600); } /* * Additionally, res_event_handler must be implemented for each EVENT_RESOURCE. From eeb90bab7789807562d9f57a3394b67b74b49857 Mon Sep 17 00:00:00 2001 From: Flo Date: Wed, 24 Aug 2016 00:59:47 +0200 Subject: [PATCH 2/2] gets rid of 'deprecated conversion from string constant to char*' --- examples/osd/triggerbaord/sketch.pde | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 examples/osd/triggerbaord/sketch.pde diff --git a/examples/osd/triggerbaord/sketch.pde b/examples/osd/triggerbaord/sketch.pde old mode 100644 new mode 100755 index 9980238b1..d026c6985 --- a/examples/osd/triggerbaord/sketch.pde +++ b/examples/osd/triggerbaord/sketch.pde @@ -45,11 +45,13 @@ void setup (void) SENSORS_ACTIVATE(button_sensor); // init coap resourcen rest_init_engine (); + #pragma GCC diagnostic ignored "-Wwrite-strings" rest_activate_resource (&res_led, "s/led"); rest_activate_resource (&res_bled, "s/bled"); rest_activate_resource (&res_battery, "s/battery"); rest_activate_resource (&res_cputemp, "s/cputemp"); rest_activate_resource(&res_event, "s/button"); + #pragma GCC diagnostic pop // NETSTACK_MAC.off(1); }