Dreamforce 2015 BLE-based mDS HeartRate Monitor Endpoint

Dependencies:   GroveEarbudSensor mbed mbedConnectorInterface mbedEndpointNetwork_BLE

Revision:
42:9741365cff35
Parent:
41:b135f327b28c
Child:
43:0c80682b673d
--- a/main.cpp	Sat Jul 25 06:11:51 2015 +0000
+++ b/main.cpp	Sat Jul 25 20:42:45 2015 +0000
@@ -72,11 +72,15 @@
 #include "HeartrateResource.h"
 HeartrateResource hr(&logger,"888/0/5850",true); // observable   
 
+// Location Resource
+#include "LocationResource.h"
+LocationResource location(&logger,"999/0/1234",true); // observable
+
 // My NSP Domain
 #define MY_NSP_DOMAIN                           "domain" 
 
 // Customization Example: My custom NSP IPv4 address and NSP CoAP port 
-uint8_t my_nsp_address[NSP_IP_ADDRESS_LENGTH] = {129,41,131,150};       // bluemix VM
+uint8_t my_nsp_address[NSP_IP_ADDRESS_LENGTH] = {23,99,29,171};       // connector (api.connector.mbed.org)
 int my_nsp_coap_port                          = 5683;
 
 // called from the Endpoint::start() below to create resources and the endpoint internals...
@@ -100,7 +104,8 @@
                  .addResource(&model)
                  
                  // add the heartrate resource
-                 .addResource(&hr)                                         // Resource implements its own observationing...
+                 .addResource(&hr)                    // Resource implements its own observationing...
+                 .addResource(&location,30000)        // observe every 30 seconds
                                       
                  // finalize the configuration...
                  .build();