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

The callbacks of a TinyCTSPeripheral: it asks the handler for the value when a client reads a characteristic, and passes on what a client writes. TinyCTSServer implements it. More...

#include <TinyCTSDesktop.h>

Inheritance diagram for tiny_cts::TinyCTSPeripheralHandler:
tiny_cts::TinyCTSServer

Public Member Functions

virtual bool onRead (uint16_t uuid, std::vector< uint8_t > &value)=0
virtual bool onWrite (uint16_t uuid, const uint8_t *data, size_t len)=0

Detailed Description

The callbacks of a TinyCTSPeripheral: it asks the handler for the value when a client reads a characteristic, and passes on what a client writes. TinyCTSServer implements it.

The functions may be called from a thread of the Bluetooth stack (macOS, Windows) or from TinyCTSPeripheral::process() (Linux).

Member Function Documentation

◆ onRead()

virtual bool tiny_cts::TinyCTSPeripheralHandler::onRead ( uint16_t uuid,
std::vector< uint8_t > & value )
pure virtual

A client reads a characteristic: return its value.

Implemented in tiny_cts::TinyCTSServer.

◆ onWrite()

virtual bool tiny_cts::TinyCTSPeripheralHandler::onWrite ( uint16_t uuid,
const uint8_t * data,
size_t len )
pure virtual

A client writes a characteristic: return false to refuse.

Implemented in tiny_cts::TinyCTSServer.


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