rename BLEUart flush_tx_buffered() to _flush_txd()

This commit is contained in:
hathach committed 2019-02-26 20:29:16 +07:00
1 parent 802b7e01e9
commit 59b12ded0e
2 files changed
+7 -11

No files matched your search

@@ -83,13 +83,8 @@ BLEUart::~BLEUart()
if ( _tx_fifo ) delete _tx_fifo;
}
/**
* Callback when received new data
* @param chr
* @param data
* @param len
* @param offset
*/
// Callback when received new data
void bleuart_rxd_cb(uint16_t conn_hdl, BLECharacteristic* chr, uint8_t* data, uint16_t len, uint16_t offset)
{
(void) conn_hdl;
@@ -119,7 +114,7 @@ void bleuart_txd_buffered_hdlr(TimerHandle_t timer)
if ( !svc->_tx_fifo ) return;
// flush tx data
(void) svc->flush_tx_buffered();
(void) svc->_flush_txd();
}
void bleuart_txd_cccd_cb(uint16_t conn_hdl, BLECharacteristic* chr, uint16_t value)
@@ -277,7 +272,7 @@ size_t BLEUart::write (const uint8_t *content, size_t len, uint16_t conn_hdl)
else
{
// TX fifo has enough data, send notify right away
VERIFY( flush_tx_buffered(conn_hdl), 0);
VERIFY( _flush_txd(conn_hdl), 0);
// still more data left, send them all
if ( written < len )
@@ -306,7 +301,7 @@ void BLEUart::flush (void)
_rx_fifo->clear();
}
bool BLEUart::flush_tx_buffered(uint16_t conn_hdl)
bool BLEUart::_flush_txd(uint16_t conn_hdl)
{
// use default conn handle if not passed
if ( conn_hdl == BLE_CONN_HANDLE_INVALID ) conn_hdl = Bluefruit.connHandle();
@@ -89,12 +89,13 @@ class BLEUart : public BLEService, public Stream
bool _tx_buffered; // default is false
TimerHandle_t _buffered_th;
bool flush_tx_buffered(uint16_t conn_hdl = BLE_CONN_HANDLE_INVALID);
bool _flush_txd(uint16_t conn_hdl = BLE_CONN_HANDLE_INVALID);
// from BLEService
virtual void _disconnect_cb(void);
virtual void _connect_cb(void);
// friend callbacks
friend void bleuart_rxd_cb(uint16_t conn_hdl, BLECharacteristic* chr, uint8_t* data, uint16_t len, uint16_t offset);
friend void bleuart_txd_cccd_cb(uint16_t conn_hdl, BLECharacteristic* chr, uint16_t value);
friend void bleuart_txd_buffered_hdlr(TimerHandle_t timer);