Fix upstream issue #173 - lost UART packets.

In case the application is sending more notifications back-to-back
and the framework has no free buffer slots error code was returned
instead of false, which was interpreted as success.
Return false in such a case, in line with SD buffer overflow handling
below.
This commit is contained in:
Petr Nejedly committed 2018-09-01 11:54:58 -07:00
1 parent 6c32bd8ff7
commit 89ba0b1aac
1 file changed
+2 -1
@@ -539,7 +539,8 @@ bool BLECharacteristic::notify(const void* data, uint16_t len)
while ( remaining )
{
// TODO multiple connection support
if ( !Bluefruit.Gap.getHvnPacket( Bluefruit.connHandle() ) ) return NRF_ERROR_RESOURCES; //BLE_ERROR_NO_TX_PACKETS;
// With no free buffers, give the app a channce to retry gracefully
if ( !Bluefruit.Gap.getHvnPacket( Bluefruit.connHandle() ) ) return false;
uint16_t packet_len = min16(max_payload, remaining);