mirror of https://github.com/ARMmbed/mbed-os.git
Beetle BLE: Fix variable length GATT attribute
Variable length flag was lost during attribute settings, so variable length GATT attributes should have been set to the predefined maximum length. This fixes issue #86. Change-Id: Ia0cd236ecd903fdb9e62a21bffef57d1e63764b9pull/5427/head
parent
873d7d10fe
commit
4ffe2aa612
|
@ -130,6 +130,9 @@ ble_error_t ArmGattServer::addService(GattService &service)
|
|||
currAtt->pLen = p_char->getValueAttribute().getLengthPtr();
|
||||
currAtt->maxLen = p_char->getValueAttribute().getMaxLength();
|
||||
currAtt->settings = ATTS_SET_WRITE_CBACK | ATTS_SET_READ_CBACK;
|
||||
if (p_char->getValueAttribute().hasVariableLength()) {
|
||||
currAtt->settings |= ATTS_SET_VARIABLE_LEN;
|
||||
}
|
||||
if (p_char->getValueAttribute().getUUID().shortOrLong() == UUID::UUID_TYPE_LONG) {
|
||||
currAtt->settings |= ATTS_SET_UUID_128;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue