Kojto CC3000 Hostdriver With Mbed Socket interface

Dependents:   WiFiDip-KitchenSink WiFiDip-UsbKitchenSink WiFiDipCortexSensor WifiDipCortex-UDPDemo

Fork of cc3000_hostdriver_mbedsocket by Martin Kojtal

Files at this revision

API Documentation at this revision

Comitter:
Kojto
Date:
Thu Sep 19 08:04:22 2013 +0000
Parent:
2:c43a6fe1f89a
Child:
4:15b58c119a0a
Commit message:
buffer clean up

Changed in this revision

Socket/TCPSocketConnection.cpp Show annotated file Show diff for this revision Revisions of this file
cc3000.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Socket/TCPSocketConnection.cpp	Thu Sep 19 08:02:13 2013 +0000
+++ b/Socket/TCPSocketConnection.cpp	Thu Sep 19 08:04:22 2013 +0000
@@ -39,18 +39,7 @@
 // -1 if unsuccessful, else number of bytes written
 int TCPSocketConnection::send_all(char* data, int length)
 {
-    Timer tmr;
-    int idx = 0;
-    tmr.start();
 
-    while ((tmr.read_ms() < _timeout) || _blocking) {
-
-        idx += wifi->send(data, length);
-
-        if (idx == length)
-            return idx;
-    }
-    return (idx == 0) ? -1 : idx;
 }
 
 // -1 if unsuccessful, else number of bytes received
--- a/cc3000.cpp	Thu Sep 19 08:02:13 2013 +0000
+++ b/cc3000.cpp	Thu Sep 19 08:04:22 2013 +0000
@@ -49,7 +49,7 @@
 
 cc3000::cc3000(PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi, IRQn_Type irq_port)
             :  _event(_simple_link, _hci, _spi, *this), _socket(_simple_link, _hci, _event), _spi(cc3000_irq, cc3000_en, cc3000_cs, cc3000_spi, irq_port, _event, _simple_link), _hci(_spi),
-            _nvmem(_hci, _event, _simple_link), _netapp(_simple_link, _nvmem, _hci, _event), _wlan(_simple_link, _event, _spi, _hci), _buffer(256) {
+            _nvmem(_hci, _event, _simple_link), _netapp(_simple_link, _nvmem, _hci, _event), _wlan(_simple_link, _event, _spi, _hci) {
     /* TODO - pIRQ riorities ?? */
 
     _simple_link.set_tx_complete_signal(1);
@@ -426,19 +426,6 @@
     return _ping_report.packets_received;
 }
 
-int32_t cc3000::readable(void) {
-    return _buffer.available();
-}
-
-uint8_t cc3000::getc(void)
-{
-    char c;
-
-    while (!_buffer.available());
-    _buffer.dequeue(&c);
-    return (uint8_t)c;
-}
-
 /* Conversion between uint types and C strings */
 uint8_t* UINT32_TO_STREAM_f (uint8_t *p, uint32_t u32)
 {