|
TinyCTS
Bluetooth Current Time Service client and server for Arduino
|
The client side (central role) of the Bluetooth stack of the operating system: finds a device, connects to it and reads or writes the characteristics of its Current Time Service. More...
#include <TinyCTSDesktop.h>
Public Member Functions | |
| virtual bool | connect (const std::string &device, uint32_t timeoutMs, TinyCTSScanEntry &found, std::string &error)=0 |
| virtual void | disconnect ()=0 |
| virtual bool | read (uint16_t uuid, std::vector< uint8_t > &value, std::string &error)=0 |
| virtual bool | scan (uint32_t timeoutMs, std::vector< TinyCTSScanEntry > &result, std::string &error)=0 |
| virtual bool | write (uint16_t uuid, const uint8_t *data, size_t len, std::string &error)=0 |
The client side (central role) of the Bluetooth stack of the operating system: finds a device, connects to it and reads or writes the characteristics of its Current Time Service.
All the functions block until they are done and give the reason in the error string when they fail. BlueZ (Linux), CoreBluetooth (macOS) and WinRT (Windows) each implement it; TinyCTSClient uses it. Get an object with ctsCreateCentral().
|
pure virtual |
Find a device, connect and discover the Current Time Service.
| device | Address, identifier or name. Empty: the first device that advertises the service. |
| timeoutMs | Time to look for the device. |
Implemented in anonymous_namespace{TinyCTSCoreBluetooth.mm}::CoreBluetoothCentral, anonymous_namespace{TinyCTSWinRT.cpp}::WinCentral, and tiny_cts::TinyCTSBlueZCentral.
|
pure virtual |
Disconnect.
Implemented in anonymous_namespace{TinyCTSCoreBluetooth.mm}::CoreBluetoothCentral, anonymous_namespace{TinyCTSWinRT.cpp}::WinCentral, and tiny_cts::TinyCTSBlueZCentral.
|
pure virtual |
Read a characteristic of the connected device (16 bit UUID).
Implemented in anonymous_namespace{TinyCTSCoreBluetooth.mm}::CoreBluetoothCentral, anonymous_namespace{TinyCTSWinRT.cpp}::WinCentral, and tiny_cts::TinyCTSBlueZCentral.
|
pure virtual |
List the devices in range.
Implemented in anonymous_namespace{TinyCTSCoreBluetooth.mm}::CoreBluetoothCentral, anonymous_namespace{TinyCTSWinRT.cpp}::WinCentral, and tiny_cts::TinyCTSBlueZCentral.
|
pure virtual |
Write a characteristic of the connected device (with response).
Implemented in anonymous_namespace{TinyCTSCoreBluetooth.mm}::CoreBluetoothCentral, anonymous_namespace{TinyCTSWinRT.cpp}::WinCentral, and tiny_cts::TinyCTSBlueZCentral.