Merge remote-tracking branch 'origin/master' into quaternion-service

This commit is contained in:
hathach committed 2020-02-24 23:37:41 +07:00
commit 0a73db570d
3 files changed
+12 -1

No files matched your search

@@ -687,7 +687,12 @@ bool BLECharacteristic::notify(uint16_t conn_hdl, const void* data, uint16_t len
};
LOG_LV2("CHR", "Notify %d bytes", packet_len);
VERIFY_STATUS( sd_ble_gatts_hvx(conn_hdl, &hvx_params), false );
uint32_t status = sd_ble_gatts_hvx(conn_hdl, &hvx_params);
if(NRF_SUCCESS != status)
{
conn->releaseHvnPacket();
}
VERIFY_STATUS(status, false );
remaining -= packet_len;
u8data += packet_len;
@@ -210,6 +210,11 @@ bool BLEConnection::getHvnPacket (void)
return xSemaphoreTake(_hvn_sem, ms2tick(BLE_GENERIC_TIMEOUT));
}
bool BLEConnection::releaseHvnPacket(void)
{
return xSemaphoreGive(_hvn_sem);
}
bool BLEConnection::getWriteCmdPacket (void)
{
return xSemaphoreTake(_wrcmd_sem, ms2tick(BLE_GENERIC_TIMEOUT));
@@ -100,6 +100,7 @@ class BLEConnection
void stopRssi(void);
bool getHvnPacket(void);
bool releaseHvnPacket(void);
bool getWriteCmdPacket(void);
bool waitForIndicateConfirm(void);