cc3000 driver with expanded buffers.

Fork of cc3000_hostdriver_mbedsocket by Martin Kojtal

Revision:
38:1d374a7f0c0d
Parent:
26:456f73ed2a75
Child:
41:eb1999bd50fb
--- 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;
+        }
     }
 }