Skip to content

Commit ffe4a37

Browse files
committed
Add congestion helper
1 parent 1b93325 commit ffe4a37

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Firmware/RTK_Surveyor/src/BluetoothSerial/BluetoothSerial.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,4 +885,9 @@ bool BluetoothSerial::isReady(bool checkMaster, int timeout) {
885885
TickType_t xTicksToWait = timeout / portTICK_PERIOD_MS;
886886
return (xEventGroupWaitBits(_spp_event_group, SPP_RUNNING, pdFALSE, pdTRUE, xTicksToWait) & SPP_RUNNING) != 0;
887887
}
888+
889+
bool BluetoothSerial::isCongested(){
890+
return(!(xEventGroupGetBits(_spp_event_group) & SPP_CONGESTED));
891+
}
892+
888893
#endif

Firmware/RTK_Surveyor/src/BluetoothSerial/BluetoothSerial.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class BluetoothSerial: public Stream
6161
bool disconnect();
6262
bool unpairDevice(uint8_t remoteAddress[]);
6363

64+
bool isCongested();
65+
6466
private:
6567
String local_name;
6668

0 commit comments

Comments
 (0)