Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b4a9684

Browse filesBrowse files
mishafarmsme-no-dev
andcommitted
Fix SerialBT.flush (espressif#3579)
* Fix flush flush should not flush the read buffer, it should wait till all output is drained from the write buffer. * Update BluetoothSerial.cpp Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
1 parent 1977370 commit b4a9684
Copy full SHA for b4a9684

File tree

1 file changed

+5
-1
lines changed
Filter options

1 file changed

+5
-1
lines changed

‎libraries/BluetoothSerial/src/BluetoothSerial.cpp

Copy file name to clipboardExpand all lines: libraries/BluetoothSerial/src/BluetoothSerial.cpp
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,11 @@ size_t BluetoothSerial::write(const uint8_t *buffer, size_t size)
660660

661661
void BluetoothSerial::flush()
662662
{
663-
while(read() >= 0){}
663+
if (_spp_tx_queue != NULL){
664+
while(uxQueueMessagesWaiting(_spp_tx_queue) > 0){
665+
delay(5);
666+
}
667+
}
664668
}
665669

666670
void BluetoothSerial::end()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.