![](/media/cache/profiles/108fe115000c147427da50c2b0c9ce31.jpg.50x50_q85.jpg)
cc3000 websocket demo for cc3000
Dependencies: NVIC_set_all_priorities WebSocketClient cc3000_hostdriver_mbedsocket mbed
Diff: main.cpp
- Revision:
- 9:822a9333d544
- Parent:
- 7:a671c9a84867
- Child:
- 10:a7f01c5e1e19
diff -r 0112f326713b -r 822a9333d544 main.cpp --- 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");