cc3000 UDP server demo

Dependencies:   NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed

Files at this revision

API Documentation at this revision

Comitter:
Kojto
Date:
Tue Oct 08 14:59:41 2013 +0000
Parent:
0:c338c4b7ca0a
Child:
2:6079591c6683
Commit message:
Update host driver to rev 35

Changed in this revision

cc3000_hostdriver_mbedsocket.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/cc3000_hostdriver_mbedsocket.lib	Sun Oct 06 10:45:48 2013 +0000
+++ b/cc3000_hostdriver_mbedsocket.lib	Tue Oct 08 14:59:41 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/Kojto/code/cc3000_hostdriver_mbedsocket/#8c7cc1c76ff8
+http://mbed.org/users/Kojto/code/cc3000_hostdriver_mbedsocket/#9dd909fb7caf
--- a/main.cpp	Sun Oct 06 10:45:48 2013 +0000
+++ b/main.cpp	Tue Oct 08 14:59:41 2013 +0000
@@ -68,11 +68,11 @@
  *  \return none
  */
 void connect_to_ssid(char *ssid, char *key, unsigned char sec_mode) {
-    printf("Connecting to SSID: %s. Timeout is 10s.\n",ssid);
+    printf("Connecting to SSID: %s. Timeout is 10s. \r\n",ssid);
     if (wifi.connect_to_AP((uint8_t *)ssid, (uint8_t *)key, sec_mode) == true) {
-        printf(" Connected\n");
+        printf(" Connected. \r\n");
     } else {
-        printf(" Connection timed-out (error). Please restart.\n");
+        printf(" Connection timed-out (error). Please restart. \r\n");
         while(1);
   }
 }
@@ -105,7 +105,7 @@
 }
 
 /**
- *  \brief Websocket demo
+ *  \brief UDP server demo
  *  \param  none
  *  \return int
  */
@@ -114,7 +114,7 @@
     pc.baud(115200);
 
     wifi.start(0);
-    printf("CC3000 tcp client demo.\n");
+    printf("CC3000 UDP server demo. \r\n");
     print_cc3000_info();
 
     printf("Attempting SSID Connection. \r\n");
@@ -157,10 +157,10 @@
     Endpoint client;
     char buffer[256];
     while (true) {
-        printf("\nWait for packet...\n");
+        printf("\r\nWait for packet...\r\n");
         int n = server.receiveFrom(client, buffer, sizeof(buffer));
         
-        printf("Received packet from: %s\n", client.get_address());
+        printf("Received packet from: %s \r\n", client.get_address());
         server.sendTo(client, buffer, n);
     }