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 7:afaa17c11965, committed 2013-10-08
- Comitter:
- Kojto
- Date:
- Tue Oct 08 15:04:55 2013 +0000
- Parent:
- 6:6eaae34586b8
- Child:
- 8:be68e827aa53
- Commit message:
- Update host driver to rev 35
Changed in this revision
--- a/cc3000_hostdriver_mbedsocket.lib Sun Oct 06 12:31:50 2013 +0200 +++ b/cc3000_hostdriver_mbedsocket.lib Tue Oct 08 15:04:55 2013 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/Kojto/code/cc3000_hostdriver_mbedsocket/#30b6ed7bf8fd +http://mbed.org/users/Kojto/code/cc3000_hostdriver_mbedsocket/#9dd909fb7caf
--- a/main.cpp Sun Oct 06 12:31:50 2013 +0200
+++ b/main.cpp Tue Oct 08 15:04:55 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,19 +101,21 @@
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");
}
-/** Start smart config
- * \param none
+/**
+ * \brief Start smart config
+ * \param none
* \return none
*/
void start_smart_config() {
wifi.start_smart_config(smartconfigkey);
}
-/** Main function
- * \param none
+/**
+ * \brief Simple socket demo
+ * \param none
* \return int
*/
int main() {
@@ -121,7 +123,7 @@
pc.baud(115200);
wifi.start(0);
- printf("cc3000 Simple socket demo. \r\n");
+ printf("cc3000 simple socket demo. \r\n");
print_cc3000_info();
printf("\n<0> Normal run. SmartConfig will \r\n start if no valid connection exists. \r\n");
--- a/main.h Sun Oct 06 12:31:50 2013 +0200 +++ b/main.h Tue Oct 08 15:04:55 2013 +0000 @@ -32,9 +32,9 @@ #define USE_SMART_CONFIG 0 // Default SSID Settings -#define AP_KEY "zxcvbnm,./" +#define AP_KEY "test" #define AP_SECURITY WPA2 // WPA2 must be enabled for use with iPhone or Android phone hotspot! -#define SSID "SSID" +#define SSID "test" #define USE_DHCP 1 #define USE_STATIC_IP 2
