Skip to content

Commit 89ba0b1

Browse files
committed
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.
1 parent 6c32bd8 commit 89ba0b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/Bluefruit52Lib/src/BLECharacteristic.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,8 @@ bool BLECharacteristic::notify(const void* data, uint16_t len)
539539
while ( remaining )
540540
{
541541
// TODO multiple connection support
542-
if ( !Bluefruit.Gap.getHvnPacket( Bluefruit.connHandle() ) ) return NRF_ERROR_RESOURCES; //BLE_ERROR_NO_TX_PACKETS;
542+
// With no free buffers, give the app a channce to retry gracefully
543+
if ( !Bluefruit.Gap.getHvnPacket( Bluefruit.connHandle() ) ) return false;
543544

544545
uint16_t packet_len = min16(max_payload, remaining);
545546

0 commit comments

Comments
 (0)