use counting semaphore for tx buf management

This commit is contained in:
hathach committed 2017-01-06 23:47:29 +07:00
1 parent f9828071fa
commit b278db8755
5 files changed
+22 -33

No files matched your search

@@ -344,6 +344,9 @@ err_t BLECharacteristic::notify(const uint8_t* data, int len, uint16_t offset)
{
if ( !_properties.notify ) return NRF_ERROR_INVALID_PARAM;
// Txbuf available or not we still update the chars'value
(void) Bluefruit.txbuf_get(100);
uint16_t len16 = (uint16_t) len;
ble_gatts_hvx_params_t hvx_params =
@@ -357,8 +360,6 @@ err_t BLECharacteristic::notify(const uint8_t* data, int len, uint16_t offset)
VERIFY_STATUS( sd_ble_gatts_hvx(Bluefruit.connHandle(), &hvx_params) );
Bluefruit.txbuf_decrease();
return NRF_SUCCESS;
}