Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
Characteristic< const char * > Class Reference

A string value. More...

#include <cs_Characteristic.h>

Inheritance diagram for Characteristic< const char * >:
Collaboration diagram for Characteristic< const char * >:

Public Member Functions

 Characteristic ()
 
cs_ret_code_t setInitialValue (const char *value)
 Set the initial value. More...
 
cs_ret_code_t setValue (const char *value)
 Set the new (plain text) value. More...
 
const char * getValue ()
 Return the (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...
 

Private Attributes

char _value [DEFAULT_CHAR_VALUE_STRING_LENGTH]
 0 terminated string. More...
 

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...
 
- Protected Attributes inherited from CharacteristicBase
friend Service
 

Detailed Description

A string value.

Constructor & Destructor Documentation

◆ Characteristic()

Characteristic< const char * >::Characteristic ( )
inline

Member Function Documentation

◆ getValue()

const char * Characteristic< const char * >::getValue ( )
inline

Return the (plain text) value.

◆ setInitialValue()

cs_ret_code_t Characteristic< const char * >::setInitialValue ( const char *  value)
inline

Set the initial value.

Must be set before init.

◆ setValue()

cs_ret_code_t Characteristic< const char * >::setValue ( const char *  value)
inline

Set the new (plain text) value.

Member Data Documentation

◆ _value

char Characteristic< const char * >::_value[DEFAULT_CHAR_VALUE_STRING_LENGTH]
private

0 terminated string.


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