Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
Characteristic< T > Class Template Reference

Characteristic of generic type T. More...

#include <cs_Characteristic.h>

Inheritance diagram for Characteristic< T >:
Collaboration diagram for Characteristic< T >:

Public Member Functions

 Characteristic ()
 
virtual ~Characteristic ()
 
cs_ret_code_t setInitialValue (const T &value)
 Set the initial value. More...
 
T & getValue ()
 Return the (plain text) value. More...
 
cs_ret_code_t setValue (const T &value)
 Set the new (plain text) value. More...
 
- Public Member Functions inherited from CharacteristicBase
 CharacteristicBase ()
 
virtual ~CharacteristicBase ()
 
cs_ret_code_t setName (const char *const name)
 Set the name of this characteristic. More...
 
cs_ret_code_t setUuid (uint16_t uuid)
 Set the UUID of this characteristic. More...
 
cs_ret_code_t setConfig (const characteristic_config_t &config)
 Set configuration for this characteristic. More...
 
cs_ret_code_t setEventHandler (const characteristic_callback_t &closure)
 Register an event handler. More...
 
cs_ret_code_t setValueBuffer (buffer_ptr_t buffer, cs_buffer_size_t size)
 Set the buffer to be used for the (plain text) characteristic value. More...
 
cs_ret_code_t setInitialValueLength (cs_buffer_size_t size)
 Set the initial value length. More...
 
cs_ret_code_t init (Service *svc)
 Initialize the characteristic: add it to the softdevice. More...
 
cs_ret_code_t updateValue (uint16_t length)
 Call this function when you changed the characteristic value. More...
 
cs_ret_code_t notify (uint16_t length=0, uint16_t offset=0)
 Notify or indicate the characteristic value. More...
 
cs_data_t getValue ()
 Get the current (plain text) value. More...
 
uint16_t getValueHandle ()
 Get the value handle. More...
 
uint16_t getCccdHandle ()
 Get the CCCD handle. More...
 
bool isSubscribedForNotifications ()
 Return true when the client subscribed for notifications or indications. More...
 

Protected Attributes

_value
 The (plain text) value. More...
 
- Protected Attributes inherited from CharacteristicBase
friend Service
 

Additional Inherited Members

- Protected Member Functions inherited from CharacteristicBase
void onWrite (uint16_t length)
 Function to be called by the stack when this characteristic is written over BLE. More...
 
void onNotificationDone ()
 Function to be called by the stack when the notification or indication has been sent. More...
 
void onCccdWrite (const uint8_t *data, uint16_t size)
 Function to be called by the stack when this characteristic configuration is written over BLE. More...
 
void onConnect ()
 Function to be called by the stack on connect. More...
 
void onDisconnect ()
 Function to be called by the stack on disconnect. More...
 

Detailed Description

template<class T>
class Characteristic< T >

Characteristic of generic type T.

Constructor & Destructor Documentation

◆ Characteristic()

template<class T >
Characteristic< T >::Characteristic ( )
inline

◆ ~Characteristic()

template<class T >
virtual Characteristic< T >::~Characteristic ( )
inlinevirtual

Member Function Documentation

◆ getValue()

template<class T >
T & Characteristic< T >::getValue ( )
inline

Return the (plain text) value.

◆ setInitialValue()

template<class T >
cs_ret_code_t Characteristic< T >::setInitialValue ( const T &  value)
inline

Set the initial value.

Must be set before init.

◆ setValue()

template<class T >
cs_ret_code_t Characteristic< T >::setValue ( const T &  value)
inline

Set the new (plain text) value.

Member Data Documentation

◆ _value

template<class T >
T Characteristic< T >::_value
protected

The (plain text) value.


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