Merge pull request #10072 from nick-atmosphereiot/master

Adding variable length attributes to Maxim Feather
pull/10275/head
Cruz Monrreal 2019-03-29 10:10:21 -05:00 committed by GitHub
commit 1c35b95d89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -146,6 +146,11 @@ ble_error_t MaximGattServer::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;
}