18#ifndef NIMBLE_CPP_VALUE_ATTRIBUTE_H_
19#define NIMBLE_CPP_VALUE_ATTRIBUTE_H_
22#if defined(CONFIG_BT_ENABLED) && (defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL) || defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL))
24# include "NimBLEAttribute.h"
25# include "NimBLEAttValue.h"
27class NimBLEValueAttribute {
30 : m_value(initLen, maxLen) {}
37 NimBLEAttValue getValue(time_t* timestamp)
const {
return m_value.getValue(timestamp); }
49 size_t getLength()
const {
return m_value.
size(); }
61 typename std::enable_if<std::is_trivially_copyable<T>::value, T>::type
62 getValue(time_t* timestamp =
nullptr,
bool skipSizeCheck =
false)
const {
63 return m_value.getValue<T>(timestamp, skipSizeCheck);
76 typename std::enable_if<!std::is_trivially_copyable<T>::value && std::is_convertible<T, NimBLEAttValue>::value, T>::type
77 getValue(time_t* timestamp =
nullptr,
bool skipSizeCheck =
false)
const {
A specialized container class to hold BLE attribute values.
Definition NimBLEAttValue.h:71
uint16_t size() const
Returns the current size of the value in bytes.
Definition NimBLEAttValue.h:158
#define CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH
Uncomment to set the default allocation size (bytes) for each attribute if not specified when the con...
Definition nimconfig.h:68