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:
2:7e489126fe7a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dbg.h	Tue Oct 15 12:45:46 2013 +0000
@@ -0,0 +1,17 @@
+#ifndef DEBUG_H
+#define DEBUG_H
+
+#include "nsdl_support.h"
+#include "mbed.h"
+
+//Debug is disabled by default
+#define DEBUG 1
+
+#if (DEBUG)
+extern Serial pc;
+#define NSDL_DEBUG(x, ...) pc.printf("[NSDL_DEBUG: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
+#else
+#define NSDL_DEBUG(x, ...)
+#endif
+
+#endif
\ No newline at end of file