Skip to content

Commit 4ffe2aa

Browse files
gaborkertesz0xc0170
authored andcommitted
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: Ia0cd236ecd903fdb9e62a21bffef57d1e63764b9
1 parent 873d7d1 commit 4ffe2aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

features/FEATURE_BLE/targets/TARGET_ARM_SSG/TARGET_BEETLE/source/ArmGattServer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ ble_error_t ArmGattServer::addService(GattService &service)
130130
currAtt->pLen = p_char->getValueAttribute().getLengthPtr();
131131
currAtt->maxLen = p_char->getValueAttribute().getMaxLength();
132132
currAtt->settings = ATTS_SET_WRITE_CBACK | ATTS_SET_READ_CBACK;
133+
if (p_char->getValueAttribute().hasVariableLength()) {
134+
currAtt->settings |= ATTS_SET_VARIABLE_LEN;
135+
}
133136
if (p_char->getValueAttribute().getUUID().shortOrLong() == UUID::UUID_TYPE_LONG) {
134137
currAtt->settings |= ATTS_SET_UUID_128;
135138
}

0 commit comments

Comments
 (0)