Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/BluetoothSerial/keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BluetoothSerial KEYWORD1
#######################################

SerialBT KEYWORD2

hasClient KEYWORD2

#######################################
# Constants (LITERAL1)
Expand Down
9 changes: 9 additions & 0 deletions libraries/BluetoothSerial/src/BluetoothSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "esp_spp_api.h"

#define SPP_SERVER_NAME "ESP32_SPP_SERVER"
#define SPP_TAG "BluetoothSerial"

#define QUEUE_SIZE 256
uint32_t client;
Expand Down Expand Up @@ -188,6 +189,14 @@ int BluetoothSerial::peek(void)
return -1;
}

bool BluetoothSerial::hasClient(void)
{
if (client)
return true;

return false;
}

int BluetoothSerial::read(void)
{
if (available()){
Expand Down
1 change: 1 addition & 0 deletions libraries/BluetoothSerial/src/BluetoothSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class BluetoothSerial: public Stream
bool begin(String localName=String());
int available(void);
int peek(void);
bool hasClient(void);
int read(void);
size_t write(uint8_t c);
size_t write(const uint8_t *buffer, size_t size);
Expand Down