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

The server side (peripheral role) of the Bluetooth stack of the operating system: offers the Current Time Service (0x1805) with the characteristics Current Time (read, notify, write), Local Time Information (read, write) and Reference Time Information (read), and advertises it. More...

#include <TinyCTSDesktop.h>

Inheritance diagram for tiny_cts::TinyCTSPeripheral:
anonymous_namespace{TinyCTSCoreBluetooth.mm}::CoreBluetoothPeripheral anonymous_namespace{TinyCTSWinRT.cpp}::WinPeripheral tiny_cts::TinyCTSBlueZPeripheral

Public Member Functions

virtual void notify (uint16_t uuid, const std::vector< uint8_t > &value)=0
virtual void process ()=0
virtual bool start (const std::string &name, bool settable, bool encrypted, TinyCTSPeripheralHandler *handler, std::string &error)=0
virtual void stop ()=0

Detailed Description

The server side (peripheral role) of the Bluetooth stack of the operating system: offers the Current Time Service (0x1805) with the characteristics Current Time (read, notify, write), Local Time Information (read, write) and Reference Time Information (read), and advertises it.

The values are not stored: the requests of the clients are given to a TinyCTSPeripheralHandler. BlueZ (Linux), CoreBluetooth (macOS) and WinRT (Windows) each implement it; TinyCTSServer uses it. Get an object with ctsCreatePeripheral().

Member Function Documentation

◆ notify()

virtual void tiny_cts::TinyCTSPeripheral::notify ( uint16_t uuid,
const std::vector< uint8_t > & value )
pure virtual

◆ process()

virtual void tiny_cts::TinyCTSPeripheral::process ( )
pure virtual

◆ start()

virtual bool tiny_cts::TinyCTSPeripheral::start ( const std::string & name,
bool settable,
bool encrypted,
TinyCTSPeripheralHandler * handler,
std::string & error )
pure virtual

Register the service and start the advertising.

Parameters
settableThe clients may write Current Time and Local Time Information.
encryptedWriting needs an encrypted (paired) connection.

Implemented in anonymous_namespace{TinyCTSCoreBluetooth.mm}::CoreBluetoothPeripheral, anonymous_namespace{TinyCTSWinRT.cpp}::WinPeripheral, and tiny_cts::TinyCTSBlueZPeripheral.

◆ stop()


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