cc3000 websocket demo for cc3000
Dependencies: NVIC_set_all_priorities WebSocketClient cc3000_hostdriver_mbedsocket mbed
Revision 9:822a9333d544, committed 2013-10-08
- Comitter:
- Kojto
- Date:
- Tue Oct 08 15:07:59 2013 +0000
- Parent:
- 8:0112f326713b
- Child:
- 10:a7f01c5e1e19
- 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:00:51 2013 +0000 +++ b/cc3000_hostdriver_mbedsocket.lib Tue Oct 08 15:07:59 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:00:51 2013 +0000
+++ b/main.cpp Tue Oct 08 15:07:59 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);
}
}
@@ -101,7 +101,7 @@
user_info.FTC = 1;
wifi.set_user_file_info((uint8_t *)&user_info, sizeof(user_info));
wifi._wlan.stop();
- printf("FTC finished.\n");
+ printf("FTC finished. \r\n");
}
/**
@@ -149,7 +149,8 @@
wifi.get_ip_config(&ipinfo2); // data is returned in the ipinfo2 structure
printf("DHCP assigned IP Address = %d.%d.%d.%d \r\n", ipinfo2.aucIP[3], ipinfo2.aucIP[2], ipinfo2.aucIP[1], ipinfo2.aucIP[0]);
- Websocket ws("ws://sockets.mbed.org/ws/Kojto/wo");
+ /* change your_channel to your defined nickname */
+ Websocket ws("ws://sockets.mbed.org/ws/your_channel/wo");
while (!ws.connect());
printf("Connected to websocket server. \r\n");