[Tinyos-2-commits] [tinyos-main] r5757 committed - added asynchronous support for CoAP client again; fixed compiler warni...

tinyos-main at googlecode.com tinyos-main at googlecode.com
Tue Sep 20 08:12:54 PDT 2011


Revision: 5757
Author:   markushx at gmail.com
Date:     Tue Sep 20 08:08:00 2011
Log:      added asynchronous support for CoAP client again; fixed compiler  
warnings


http://code.google.com/p/tinyos-main/source/detail?r=5757

Modified:
  /trunk/support/sdk/c/coap/examples/client.c

=======================================
--- /trunk/support/sdk/c/coap/examples/client.c	Tue Sep 20 08:00:19 2011
+++ /trunk/support/sdk/c/coap/examples/client.c	Tue Sep 20 08:08:00 2011
@@ -305,23 +305,23 @@



-    if (strcmp(uri.path.s, "st") == 0 ) {
+    if (strcmp((const char *)uri.path.s, "st") == 0 ) {
        printf("\n** Temperatur: %4.2f K\n\n",  
((float)char_to_uint16(node->pdu->data))/100);
-    } else if (strcmp(uri.path.s, "sh") == 0) {
+    } else if (strcmp((const char *)uri.path.s, "sh") == 0) {
        printf("\n** Humidity: %4.2f %% \n\n",   
((float)char_to_uint16(node->pdu->data))/100);
-    } else if (strcmp(uri.path.s, "sv") == 0) {
+    } else if (strcmp((const char *)uri.path.s, "sv") == 0) {
        printf("** Voltage: %4.2f V\n\n",   
((float)char_to_uint16(node->pdu->data))/100);
-    } else if (strcmp(uri.path.s, "ck") == 0) {
+    } else if (strcmp((const char *)uri.path.s, "ck") == 0) {
        if (len != 0) {
  	printf("** AES Key received \n");
        } else {
  	printf("** AES Key set\n");
        }
-    } else if (strcmp(uri.path.s, "tsr") == 0) {
+    } else if (strcmp((const char *)uri.path.s, "tsr") == 0) {
        printf("** tsr\n");
-    } else if (strcmp(uri.path.s, "par") == 0) {
+    } else if (strcmp((const char *)uri.path.s, "par") == 0) {
        printf("** par\n");
-    } else if (strcmp(uri.path.s, "l") == 0) {
+    } else if (strcmp((const char *)uri.path.s, "l") == 0) {
        if (len != 0) {
  	printf("\n** led 0 (red)   %s\n** led 1 (green) %s\n** led 2  
(blue)  %s\n\n",
  	       ( (char_to_uint16(node->pdu->data)    %2) == 0) ? "OFF": "ON",
@@ -330,7 +330,7 @@
        } else {
  	printf("** LEDs set\n");
        }
-    } else if (strcmp(uri.path.s, "r") == 0) {
+    } else if (strcmp((const char *)uri.path.s, "r") == 0) {
        val_all val = char_to_val_all(node->pdu->data);
        printf("\n** All values: \n");
        if (val.temp != (0xFFFF | 0xFFFE))
@@ -345,8 +345,8 @@
  	printf("** Voltage:     %4.2f V\n\n",  ((float) val.volt)/100);
        else
  	printf("** Voltage:     NaN\n\n");
-    } else if (strcmp(uri.path.s, "lipsum") == 0) {
-    } else if (strcmp(uri.path.s, "time") == 0) {
+    } else if (strcmp((const char *)uri.path.s, "lipsum") == 0) {
+    } else if (strcmp((const char *)uri.path.s, "time") == 0) {
      } else {
        printf("** unknown URI\n");
      }
@@ -799,9 +799,9 @@
  	coap_dispatch( ctx );	/* and dispatch PDUs from receivequeue */

  	// koo second read is done to process the asyn response. TODO this has to  
be done properly by checking the type of message
-// 	coap_read( ctx );	/* read received data */
-// 	coap_dispatch( ctx );	/* and dispatch PDUs from receivequeue */
-// 	// koo
+	coap_read( ctx );	/* read received data */
+	coap_dispatch( ctx );	/* and dispatch PDUs from receivequeue */
+	// koo
        }
      }
    }


More information about the Tinyos-2-commits mailing list