Datasheet
BLEClientUart
BLEClientUart is a wrapper class for the client side of the NUS or 'Nordic UART Service' (aka 'BLE UART'). It is only
required when your Bluefruit nRF52 board is acting as Central communicating to other BLE peripherals that expose
the BLEUart (https://adafru.it/yud) service.
API
BLEClientUart has the following public API:
Examples
The following example shows how to use the BLEClientUart helper class.
The Bluefruit nRF52 Feather codebase is in an early BETA stage and is undergoing active development
based on customer feedback and testing. As such, the class documentation here is incomplete, and you
should consult the Github repo for the latest code and API developments: https://goo.gl/LdEx62
// Callback Signatures
typedef void (*rx_callback_t) (BLEClientUart& svc);
BLEClientUart(uint16_t fifo_depth = BLE_UART_DEFAULT_FIFO_DEPTH);
virtual bool begin(void);
virtual bool discover(uint16_t conn_handle);
void setRxCallback( rx_callback_t fp);
bool enableTXD(void);
bool disableTXD(void);
// Stream API
virtual int read ( void );
virtual int read ( uint8_t * buf, size_t size );
int read ( char * buf, size_t size ) { return read( (uint8_t*) buf, size); }
virtual size_t write ( uint8_t b );
virtual size_t write ( const uint8_t *content, size_t len );
virtual int available ( void );
virtual int peek ( void );
virtual void flush ( void );
#include <bluefruit.h>
BLEClientDis clientDis;
BLEClientUart clientUart;
void setup()
{
Serial.begin(115200);
Serial.println("Bluefruit52 Central BLEUART Example");
Serial.println("-----------------------------------\n");
// Initialize Bluefruit with maximum connections as Peripheral = 0, Central = 1
© Adafruit Industries https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide Page 130 of 175