CoAP Device Server Client

Dependencies:   EthernetInterface mbed-rtos mbed nsdl_lib

Fork of COAPmbed by th.iotkit2.ch

Constrained Application Protocol (Coap) ist ein Software-Protokoll welches für Internet der Dinge Geräte zugeschnitten ist.

COAP ist auf den meisten Geräten, die UDP Unterstützen, lauffähig.

Ein COAP fähiges Gerät publiziert seine Sensoren und Aktoren in einem Resource Directory oder stellt selber ein solches zur Verfügung.

Mittels Resource Discovery können die vorhandenen Sensoren und Aktoren mit ihren Attributen abgefragt werden.

Zeile 29: Node Name aendern und folgende Adresse aufrufen: http://nsp.cloudapp.net:8083/, User/PW = demo

Revision:
10:57352d0c287c
Parent:
9:18f4959c2bac
Child:
11:99178da0f3fa
--- a/main.cpp	Sun Jan 18 15:41:27 2015 +0000
+++ b/main.cpp	Sun Jan 18 18:32:12 2015 +0000
@@ -19,7 +19,8 @@
 
 // NSP configuration
 /* Change this IP address to that of your NanoService Platform installation */
-static const char* NSP_ADDRESS = "23.97.178.38"; /* demo NSP, web interface at http://nsp.cloudapp.net:8083/, User/PW = demo */ 
+//static const char* NSP_ADDRESS = "23.97.178.38"; /* demo NSP, web interface at http://nsp.cloudapp.net:8083/, User/PW = demo */ 
+static const char* NSP_ADDRESS = "192.168.178.65"; /* Lokale Installation */ 
 static const int NSP_PORT = 5683;
 char endpoint_name[16] = "mbed-k64f-1234"; // aendern pro Node
 uint8_t ep_type[] = {"mbed_device"};
@@ -95,8 +96,8 @@
     memset(resource_ptr->resource_parameters_ptr, 0, sizeof(sn_nsdl_resource_parameters_s));
 
     // Static resources
-    nsdl_create_static_resource(resource_ptr, sizeof("dev/mfg")-1, (uint8_t*) "dev/mfg", 0, 0,  (uint8_t*) "Sensinode", sizeof("Sensinode")-1);
-    nsdl_create_static_resource(resource_ptr, sizeof("dev/mdl")-1, (uint8_t*) "dev/mdl", 0, 0,  (uint8_t*) "NSDL-C mbed device", sizeof("NSDL-C mbed device")-1);
+    nsdl_create_static_resource(resource_ptr, sizeof("dev/mfg")-1, (uint8_t*) "dev/mfg", 0, 0,  (uint8_t*) "mc-b", sizeof("mc-b")-1);
+    nsdl_create_static_resource(resource_ptr, sizeof("dev/mdl")-1, (uint8_t*) "dev/mdl", 0, 0,  (uint8_t*) "CoAP mbed device", sizeof("CoAP mbed device")-1);
 
     // Dynamic resources
     //create_temperature_resource(resource_ptr);