Alexander De Geeter / Mbed 2 deprecated coap

Dependencies:   LM75B Color mbed yeswecancoap Rgb

Revision:
2:ba4506b61052
Parent:
1:e0a4afdbbffb
--- a/main.cpp	Fri Oct 23 14:48:16 2015 +0000
+++ b/main.cpp	Tue Jan 19 00:13:37 2016 +0000
@@ -1,14 +1,19 @@
+//include the libary's
+
 #include "mbed.h"
 #include "coap.h"
 #include "rgb.h"
 #include "LM75B.h"
 
+//initialise serial en the temperature sensor
 Serial pc(USBTX, USBRX);
 LM75B sensor(p28,p27);
+//make a object from the class RGB
 RGB* rgb;
 
-
-void get_hello(Request* req, Response* res)
+//the methode to send the value of the temp sensor
+//this methode is called by a get methode
+void get_temp(Request* req, Response* res)
 {
     if(req->hasContent()) {
            
@@ -21,11 +26,14 @@
     res -> setCode(CONTENT);   
 }
 
+//this methode receive the value of the LED 
+//
 void post_led(Request* req, Response* res)
 {
     if(req->hasContent()) {
-        //rgb->setColor(req,req,req);
+        //receive the coap data
         char* test = req->getContent();
+        
         pc.printf(test);
         uint32_t hex = strtol(req->getContent(), NULL, 16);
         rgb->setColor(hex);
@@ -38,7 +46,7 @@
 int main()
 {
     Server server;
-    server.add("/led", &get_hello, GET);
+    server.add("/led", &get_temp, GET);
     server.add("/led", &post_led, POST);
     
     rgb = new RGB(p23, p24, p25);