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:
6:442775856f5f
Parent:
4:15690450a797
Child:
7:6b068978be9a
diff -r c257ee923598 -r 442775856f5f main.cpp
--- a/main.cpp	Mon Oct 21 21:29:11 2013 +0000
+++ b/main.cpp	Mon Oct 21 21:30:05 2013 +0000
@@ -26,7 +26,7 @@
 
 // NSP configuration
 /* Change this IP address to that of your NanoService Platform installation */
-static const char* NSP_ADDRESS = "217.140.101.20"; /* internal NSP*/
+static const char* NSP_ADDRESS = "217.140.101.20"; /* demo NSP, web interface at http://nanoservice-demo.mbed.org*/ 
 static const int NSP_PORT = 5683;
 char endpoint_name[16] = "mbed-demo-";
 uint8_t ep_type[] = {"mbed_device"};