MBED NanoService Lighting Endpoint for NXP Ublox (Ethernet enabled)

Dependencies:   C027 C12832 EthernetInterface StatusReporter LM75B endpoint_core endpoint_nsp mbed-rtos mbed nsp_resources

Revision:
7:cca3a2adb6b8
Parent:
6:c780baa3b7f1
Child:
9:c2a0b8f2d7f6
--- a/Definitions.h	Fri Feb 28 04:57:02 2014 +0000
+++ b/Definitions.h	Fri Feb 28 05:11:46 2014 +0000
@@ -53,12 +53,47 @@
 
 // Endpoint GPS Coordinates
 #define ENDPOINT_LOCATION   "Oulo Finland"         // Where this light/endpoint lives
-#define ENDPOINT_GPS_COORDS "65.017210,25.492411"  // Where this light/endpoint lives
+#define ENDPOINT_GPS_COORDS "65.017210,25.492411"  // work
+//#define ENDPOINT_GPS_COORDS "65.020071,25.467880"  // home
+
+// TEMP - until we get HTTPS with BasicAuth working in MBED...
+//#define GW_IPADDRESS                "192.168.1.191"     // work
+#define GW_IPADDRESS                "10.1.0.27"         // home
+#define GW_REDIRECT_URL             "http://%s:8888/NSP-IOC-Gateway/IOCRestAPI"
+#define USE_GW_HTTP_REDIRECTOR      true                            // true - make http calls to IOC via GW, false - make http calls directly to IOC
+
+// Keyword Definitions for MQTT packets
+#define IOC_REQUEST_LOAD_ALL_VERB   "load"
+#define IOC_REQUEST_UPDATE_ALL_VERB "update"
+#define IOC_ENDPOINT_VERB           "Endpoint"
+#define IOC_ENDPOINT_ALL_VERB       "all"
+#define IOC_CHANGE_VERB             "Change"
+#define IOC_REQUEST_VALUE_VERB      "Get"
+#define IOC_RESPONSE_VERB           "response"
+#define IOC_REPONSE_ID_KEY          "id"
+#define IOC_DATASOURCE_ID           "198"
+
+// IOC REST Buffer Lengths
+#define IOC_REST_URL_LEN            128
+#define IOC_RESULT_LEN              900
+#define IOC_PAYLOAD_LEN             900
+#define IOC_IOC_ID_LEN              16
+
+// IOC REST URL for Load/Updates
+#define IOC_USERNAME                "anson"
+#define IOC_PASSWORD                "savetheplanet1"
+#define IOC_HOST_NAME               "iocweb.bcu.ac.uk"
+#define IOC_REST_URL                "https://%s/ibm/ioc/api/data-injection-service/datablocks/%s/dataitems%s"
+#define IOC_RESPONSE_TEMPLATE       "%s:{ENDPOINT=%s RESOURCE=%s VALUE=%s}:%s"
+#define IOC_RESPONSE_OK             "OK"
+#define IOC_RESPONSE_FAILED         "FAILED"
 
 // Transport Configuration
-#define NUM_TRANSPORTS      1                      // NSP Only
+#define NUM_TRANSPORTS      2                      // Transports used
 #define NSP_TRANSPORT       0                      // NSP Transport index
+#define HTTP_TRANSPORT      1                      // HTTP Transport index
 
+// NSP Configuration
 #define NSP_ADDRESS         "192.168.1.150"        // Target NSP Service 
 #define NSP_PORT            8080                   // Target NSP Service Port Number