cc3000 hostdriver with the mbed socket interface

Dependents:   cc3000_hello_world_demo cc3000_simple_socket_demo cc3000_ntp_demo cc3000_ping_demo ... more

Files at this revision

API Documentation at this revision

Comitter:
SolderSplashLabs
Date:
Tue Oct 08 22:37:53 2013 +0000
Parent:
35:9dd909fb7caf
Child:
39:03ac37ab34eb
Commit message:
Enabling debugging

Changed in this revision

cc3000.cpp Show annotated file Show diff for this revision Revisions of this file
cc3000.h Show annotated file Show diff for this revision Revisions of this file
cc3000_event.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/cc3000.cpp	Tue Oct 08 16:38:08 2013 +0200
+++ b/cc3000.cpp	Tue Oct 08 22:37:53 2013 +0000
@@ -118,7 +118,7 @@
 void cc3000::start_smart_config(const uint8_t *smart_config_key) {
     // Reset all the previous configuration
     _wlan.ioctl_set_connection_policy(0, 0, 0);
-    _wlan.ioctl_del_profile(255);
+    //_wlan.ioctl_del_profile(255);
 
     //Wait until CC3000 is disconected
     while (_status.connected == 1)
--- a/cc3000.h	Tue Oct 08 16:38:08 2013 +0200
+++ b/cc3000.h	Tue Oct 08 22:37:53 2013 +0000
@@ -55,19 +55,19 @@
  */
 
 // Debug - Socket interface messages
-//#define CC3000_DEBUG_SOCKET
+#define CC3000_DEBUG_SOCKET
 
 // Debug - HCI TX messages
-//#define CC3000_DEBUG_HCI_TX
+#define CC3000_DEBUG_HCI_TX
 
 // Debug - HCI Rx messages
-//#define CC3000_DEBUG_HCI_RX
+#define CC3000_DEBUG_HCI_RX
 
 // Debug - General Debug
-//#define CC3000_DEBUG
+#define CC3000_DEBUG
 
 // Add colour to the debug messages, requires a VT100 terminal like putty, comment out to remove
-//#define VT100_COLOUR
+#define VT100_COLOUR
 
 #ifdef CC3000_DEBUG_SOCKET
 
--- a/cc3000_event.cpp	Tue Oct 08 16:38:08 2013 +0200
+++ b/cc3000_event.cpp	Tue Oct 08 22:37:53 2013 +0000
@@ -198,6 +198,7 @@
 #endif
 }
 
+Timer timer;
 uint8_t *cc3000_event::hci_event_handler(void *ret_param, uint8_t *from, uint8_t *fromlen) {
     uint8_t *received_data, argument_size;
     uint16_t length;
@@ -206,7 +207,11 @@
     uint32_t return_value;
     uint8_t * RecvParams;
     uint8_t *RetParams;
-
+    
+    
+    timer.reset();
+    timer.start();
+    
     while (1)
     {
         if (_simple_link.get_data_received_flag() != 0)
@@ -396,8 +401,13 @@
 
                         //Read SSID
                         STREAM_TO_STREAM(RecvParams,RetParams,NETAPP_IPCONFIG_SSID_LENGTH);
-
+                        break;
+                        
+                    default :
+                        DBG_HCI("UNKNOWN Event Received : 0x%04X ", received_op_code);
+                        break;
                     }
+ 
                 }
                 if (received_op_code == _simple_link.get_op_code())
                 {
@@ -440,6 +450,12 @@
                 return NULL;
             }
         }
+        
+        if ( timer.read_ms() > 10000)
+        {
+            DBG_HCI("TIMEOUT Waiting for CC3000 Event - BAD");
+            break;
+        }
     }
 }