cc3000 hostdriver with the mbed socket interface

Fork of cc3000_hostdriver_mbedsocket by Martin Kojtal

Revision:
51:897cfc2c7e8c
Parent:
48:192e2fde71e9
--- a/cc3000.cpp	Sun Apr 05 14:25:45 2015 +0000
+++ b/cc3000.cpp	Mon Apr 06 18:23:37 2015 +0000
@@ -47,11 +47,12 @@
 static uint8_t cc3000_prefix[] = {'T', 'T', 'T'};
 cc3000 *cc3000::_inst;
 
-cc3000::cc3000(PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi)
+cc3000::cc3000(PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi, uint32_t max_tx_size, uint32_t max_rx_size)
              : _event(_simple_link, _hci, _spi, *this), _socket(_simple_link, _hci, _event),
-               _spi(cc3000_irq, cc3000_en, cc3000_cs, cc3000_spi, _event, _simple_link), _hci(_spi),
+               _spi(cc3000_irq, cc3000_en, cc3000_cs, cc3000_spi, _event, _simple_link, max_tx_size, max_rx_size), _hci(_spi),
                _nvmem(_hci, _event, _simple_link), _netapp(_simple_link, _nvmem, _hci, _event),
                _wlan(_simple_link, _event, _spi, _hci) {
+    _simple_link.create_txrx_buffers(max_tx_size, max_rx_size);
     _simple_link.set_tx_complete_signal(1);
     memset(&_status, 0, sizeof(_status));
     _inst = this;
@@ -62,11 +63,12 @@
 
 #if (CC3000_ETH_COMPAT == 1)
 cc3000::cc3000(PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi, const char *ssid,
-               const char *phrase, Security sec, bool smart_config)
+               const char *phrase, Security sec, bool smart_config, uint32_t max_tx_size, uint32_t max_rx_size)
              : _event(_simple_link, _hci, _spi, *this), _socket(_simple_link, _hci, _event),
-               _spi(cc3000_irq, cc3000_en, cc3000_cs, cc3000_spi, _event, _simple_link), _hci(_spi),
+               _spi(cc3000_irq, cc3000_en, cc3000_cs, cc3000_spi, _event, _simple_link, max_tx_size, max_rx_size), _hci(_spi),
                _nvmem(_hci, _event, _simple_link), _netapp(_simple_link, _nvmem, _hci, _event),
                _wlan(_simple_link, _event, _spi, _hci), _sec(sec), _smart_config(smart_config) {
+    _simple_link.create_txrx_buffers(max_tx_size, max_rx_size);
     _simple_link.set_tx_complete_signal(1);
     memset(&_status, 0, sizeof(_status));
     strcpy((char *)_ssid, ssid);