![](/media/cache/group/ep_srxDLMd.webp.50x50_q85.jpg)
CoAP Device Server Client mit leshan Server
Dependencies: EthernetInterface mbed-rtos mbed nsdl_lib
Fork of COAPmbed by
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"
Diff: main.cpp
- Revision:
- 13:3c205b19c540
- Parent:
- 11:99178da0f3fa
- Child:
- 14:54c3708f7c3c
diff -r 2f67bf0e137e -r 3c205b19c540 main.cpp --- a/main.cpp Mon Mar 16 18:35:44 2015 +0000 +++ b/main.cpp Tue Mar 24 14:49:32 2015 +0000 @@ -1,3 +1,7 @@ +/** CoAP Device Server Client + Zeile 29: Node Name aendern und folgende Adresse aufrufen: + http://nsp.cloudapp.net:8083/, User/PW = demo +*/ #include "mbed.h" #include "EthernetInterface.h" #include "nsdl_support.h"