MQTT with CC3000 Wi-Fi interface
Dependencies: ADT7410 MQTToveCC3000 MbedJSONValue NVIC_set_all_priorities cc3000_hostdriver_mbedsocket2 mbed
Fork of cc3000_simple_socket_demo by
Revision 3:aab73431f03b, committed 2013-09-14
- Comitter:
- Kojto
- Date:
- Sat Sep 14 15:06:37 2013 +0000
- Parent:
- 2:c8cdcef31933
- Child:
- 4:b5875efcf0e5
- Commit message:
- error handling inside tcp_connection
Changed in this revision
| tcp_ip_demo.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/tcp_ip_demo.cpp Fri Sep 13 18:06:44 2013 +0000
+++ b/tcp_ip_demo.cpp Sat Sep 14 15:06:37 2013 +0000
@@ -57,7 +57,20 @@
stat = server.send((void *)python_msg, strlen(python_msg), 0);
printf("status= %d\n", stat);
} else {
- printf("bad socket= %d\n", stat);
+ printf("ERROR %d", stat);
+ switch (stat) {
+ case -1:
+ printf(": remote socket closed.\n");
+ break;
+ case -2:
+ printf(": no buffers available.\n");
+ break;
+ case -57:
+ printf(": timeout - no reply from remote.\n");
+ break;
+ default:
+ printf("\n");
+ }
}
server.close();
printf("Done, press any key to repeat\n");
