CoAP Device Server Client mit leshan Server

Dependencies:   EthernetInterface mbed-rtos mbed nsdl_lib

Fork of COAPmbed by smd.iotkit2.ch

Sandbox Server

Eclipse stellt einen Testserver unter http://leshan.eclipse.org/ zur Verfügung. Das Programm verbindet sich mit diesem und ist unter mbed-k64f... erreichbar.

Installation lokale Version leshan

wget https://hudson.eclipse.org/leshan/job/leshan/lastSuccessfulBuild/artifact/leshan-server-demo.jar
java -jar ./leshan-server-demo.jar

cURL

Die Funktionen können mittels cURL oder Browser wie folgt getestet werden:

# Alle Clients abfragen (Antwort im JSON Format)
curl -X GET  http://localhost:8080/api/clients
                         
# Wert von LED2 abfragen (Antwort im text/plain Format)                      
curl -X GET  http://localhost:8080/api/clients/mbed-k64f-1234/10/0/2 
 
# Wert für LED2 setzen
curl -X GET -vvv http://localhost:8080/api/clients/mbed-k64f-1234/10/0/2 -H "Content-Type: text/plain" -d "10"
Revision:
14:54c3708f7c3c
Parent:
13:3c205b19c540
Child:
15:fba25b7e63cd
diff -r 3c205b19c540 -r 54c3708f7c3c main.cpp
--- a/main.cpp	Tue Mar 24 14:49:32 2015 +0000
+++ b/main.cpp	Fri Apr 17 07:58:23 2015 +0000
@@ -24,9 +24,9 @@
 // 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 = "192.168.178.65"; /* Lokale Installation */ 
+//static const char* NSP_ADDRESS = "192.168.178.77"; /* Lokale Installation */ 
 static const int NSP_PORT = 5683;
-char endpoint_name[16] = "mbed-k64f-1234"; // aendern pro Node
+char endpoint_name[] = "mbed-k64f-1234"; // aendern pro Node
 uint8_t ep_type[] = {"mbed_device"};
 uint8_t lifetime_ptr[] = {"1200"};