TinyCTS
Bluetooth Current Time Service client and server for Arduino
Loading...
Searching...
No Matches
tiny_cts::TinyCTSBlueZCentral Class Reference

The client side for Linux: scans, connects and reads or writes the characteristics through BlueZ (org.bluez.Adapter1, Device1 and GattCharacteristic1) with the functions of TinyCTSBlueZ. More...

#include <TinyCTSBlueZBackend.h>

Inheritance diagram for tiny_cts::TinyCTSBlueZCentral:
tiny_cts::TinyCTSCentral

Public Member Functions

 TinyCTSBlueZCentral (const std::string &adapter)
bool connect (const std::string &wanted, uint32_t timeoutMs, TinyCTSScanEntry &found, std::string &error) override
void disconnect () override
bool read (uint16_t uuid, std::vector< uint8_t > &value, std::string &error) override
bool scan (uint32_t timeoutMs, std::vector< TinyCTSScanEntry > &result, std::string &error) override
bool write (uint16_t uuid, const uint8_t *data, size_t len, std::string &error) override

Detailed Description

The client side for Linux: scans, connects and reads or writes the characteristics through BlueZ (org.bluez.Adapter1, Device1 and GattCharacteristic1) with the functions of TinyCTSBlueZ.

Member Function Documentation

◆ connect()

bool tiny_cts::TinyCTSBlueZCentral::connect ( const std::string & device,
uint32_t timeoutMs,
TinyCTSScanEntry & found,
std::string & error )
inlineoverridevirtual

Find a device, connect and discover the Current Time Service.

Parameters
deviceAddress, identifier or name. Empty: the first device that advertises the service.
timeoutMsTime to look for the device.

Implements tiny_cts::TinyCTSCentral.

◆ disconnect()

void tiny_cts::TinyCTSBlueZCentral::disconnect ( )
inlineoverridevirtual

Disconnect.

Implements tiny_cts::TinyCTSCentral.

◆ read()

bool tiny_cts::TinyCTSBlueZCentral::read ( uint16_t uuid,
std::vector< uint8_t > & value,
std::string & error )
inlineoverridevirtual

Read a characteristic of the connected device (16 bit UUID).

Implements tiny_cts::TinyCTSCentral.

◆ scan()

bool tiny_cts::TinyCTSBlueZCentral::scan ( uint32_t timeoutMs,
std::vector< TinyCTSScanEntry > & result,
std::string & error )
inlineoverridevirtual

List the devices in range.

Implements tiny_cts::TinyCTSCentral.

◆ write()

bool tiny_cts::TinyCTSBlueZCentral::write ( uint16_t uuid,
const uint8_t * data,
size_t len,
std::string & error )
inlineoverridevirtual

Write a characteristic of the connected device (with response).

Implements tiny_cts::TinyCTSCentral.


The documentation for this class was generated from the following file: