File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
libraries/BluetoothSerial Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ BluetoothSerial KEYWORD1
1919#######################################
2020
2121SerialBT KEYWORD2
22-
22+ hasClient KEYWORD2
2323
2424#######################################
2525# Constants (LITERAL1)
Original file line number Diff line number Diff line change 2929#include " esp_spp_api.h"
3030
3131#define SPP_SERVER_NAME " ESP32_SPP_SERVER"
32+ #define SPP_TAG " BluetoothSerial"
3233
3334#define QUEUE_SIZE 256
3435uint32_t client;
@@ -188,6 +189,14 @@ int BluetoothSerial::peek(void)
188189 return -1 ;
189190}
190191
192+ bool BluetoothSerial::hasClient (void )
193+ {
194+ if (client)
195+ return true ;
196+
197+ return false ;
198+ }
199+
191200int BluetoothSerial::read (void )
192201{
193202 if (available ()){
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ class BluetoothSerial: public Stream
4040 bool begin (String localName=String());
4141 int available (void );
4242 int peek (void );
43+ bool hasClient (void );
4344 int read (void );
4445 size_t write (uint8_t c);
4546 size_t write (const uint8_t *buffer, size_t size);
You can’t perform that action at this time.
0 commit comments