We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5a01858 + 8035ddc commit f0a1075Copy full SHA for f0a1075
features/FEATURE_BLE/ble/services/UARTService.h
@@ -140,6 +140,19 @@ class UARTService {
140
return write(str, strlen(str));
141
}
142
143
+ /**
144
+ * Flush sendBuffer, i.e., forcefully write its contents to the UART RX
145
+ * characteristic even if the buffer is not full.
146
+ */
147
+ void flush() {
148
+ if (ble.getGapState().connected) {
149
+ if (sendBufferIndex != 0) {
150
+ ble.gattServer().write(getRXCharacteristicHandle(), static_cast<const uint8_t *>(sendBuffer), sendBufferIndex);
151
+ sendBufferIndex = 0;
152
+ }
153
154
155
+
156
/**
157
* Override for Stream::_putc().
158
* @param c
0 commit comments