19#ifndef MBED_GATT_ATTRIBUTE_H__
20#define MBED_GATT_ATTRIBUTE_H__
23#include "ble/common/BLETypes.h"
116 uint8_t *valuePtr =
nullptr,
119 bool hasVariableLen =
true
125 _hasVariableLen(hasVariableLen),
128 _write_allowed(true),
224 return _hasVariableLen;
233 _read_allowed = allow_read;
242 return _read_allowed;
251 _read_security = requirement.
value();
269 _write_allowed = allow_write;
278 return _write_allowed;
287 _write_security = requirement.
value();
328 bool _hasVariableLen;
333 uint8_t _read_allowed:1;
343 uint8_t _write_allowed:1;
Representation of a GattServer attribute.
ble::attribute_handle_t Handle_t
Representation of an attribute handle.
void allowWrite(bool allow_write)
Allow or disallow write operation from a client.
static const Handle_t INVALID_HANDLE
Invalid attribute handle.
uint16_t * getLengthPtr()
Get a pointer to the current length of the attribute value.
Handle_t getHandle() const
Get the attribute's handle in the ATT table.
bool hasVariableLength() const
Check whether the length of the attribute's value can change throughout time.
GattAttribute(const UUID &uuid, uint8_t *valuePtr=nullptr, uint16_t len=0, uint16_t maxLen=0, bool hasVariableLen=true)
Construct an attribute.
Security_t getWriteSecurityRequirement() const
Return the security level required by write operations.
void setHandle(Handle_t id)
Set the attribute handle.
uint8_t * getValuePtr()
Get a pointer to the attribute value.
void setWriteSecurityRequirement(Security_t requirement)
Set the security requirements of the write operations.
Security_t getReadSecurityRequirement() const
Return the security level required by read operations.
void setReadSecurityRequirement(Security_t requirement)
Set the security requirements of the read operations.
uint16_t getLength() const
Get the current length of the attribute value.
bool isWriteAllowed() const
Indicate if a client is allowed to write the attribute.
uint16_t getMaxLength() const
Get the maximum length of the attribute value.
bool isReadAllowed() const
Indicate if a client is allowed to read the attribute.
void allowRead(bool allow_read)
Allow or disallow read operation from a client.
const UUID & getUUID() const
Get the UUID of the attribute.
Representation of a Universally Unique Identifier (UUID).
uint16_t attribute_handle_t
Reference to an attribute in a GATT database.
LayoutType value() const
Explicit access to the inner value of the SafeEnum instance.
Security requirement that can be attached to an attribute operation.
static const uint8_t size
Number of bits required to store the value.
type
struct scoped enum wrapped by the class