17 #ifndef MBED_GATT_ATTRIBUTE_H__ 18 #define MBED_GATT_ATTRIBUTE_H__ 114 uint8_t *valuePtr = NULL,
117 bool hasVariableLen =
true 123 _hasVariableLen(hasVariableLen),
125 _read_security(Security_t::NONE),
126 _write_allowed(true),
127 _write_security(Security_t::NONE) {
219 return _hasVariableLen;
228 _read_allowed = allow_read;
237 return _read_allowed;
246 _read_security = requirement.
value();
264 _write_allowed = allow_write;
273 return _write_allowed;
282 _write_security = requirement.
value();
323 bool _hasVariableLen;
328 uint8_t _read_allowed:1;
338 uint8_t _write_allowed:1;
GattAttribute(const UUID &uuid, uint8_t *valuePtr=NULL, uint16_t len=0, uint16_t maxLen=0, bool hasVariableLen=true)
Construct an attribute.
void setReadSecurityRequirement(Security_t requirement)
Set the security requirements of the read operations.
uint8_t * getValuePtr(void)
Get a pointer to the attribute value.
void allowWrite(bool allow_write)
Allow or disallow write operation from a client.
Security_t getReadSecurityRequirement() const
Return the security level required by read operations.
static const Handle_t INVALID_HANDLE
Invalid attribute handle.
const UUID & getUUID(void) const
Get the UUID of the attribute.
Security requirement that can be attached to an attribute operation.
void allowRead(bool allow_read)
Allow or disallow read operation from a client.
LayoutType value() const
Explicit access to the inner value of the SafeEnum instance.
type
struct scoped enum wrapped by the class
uint16_t getMaxLength(void) const
Get the maximum length of the attribute value.
void setHandle(Handle_t id)
Set the attribute handle.
Representation of a Universally Unique Identifier (UUID).
Representation of a GattServer attribute.
uint16_t * getLengthPtr(void)
Get a pointer to the current length of the attribute value.
bool hasVariableLength(void) const
Check whether the length of the attribute's value can change throughout time.
ble::attribute_handle_t Handle_t
Representation of an attribute handle.
Handle_t getHandle(void) const
Get the attribute's handle in the ATT table.
Security_t getWriteSecurityRequirement() const
Return the security level required by write operations.
uint16_t getLength(void) const
Get the current length of the attribute value.
static const uint8_t size
Number of bits required to store the value.
bool isWriteAllowed(void) const
Indicate if a client is allowed to write the attribute.
bool isReadAllowed(void) const
Indicate if a client is allowed to read the attribute.
uint16_t attribute_handle_t
Reference to an attribute in a GATT database.
void setWriteSecurityRequirement(Security_t requirement)
Set the security requirements of the write operations.