Merge pull request #10418 from marcemmers/fix-cordio-gattserver-insert-characteristic

CordioGattServer: reset settings variable before ANDing the properties to it
pull/10443/head
Martin Kojtal 2019-04-18 08:14:34 +01:00 committed by GitHub
commit 998cdf2223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -321,8 +321,10 @@ ble_error_t GattServer::insert_characteristic_value_attribute(
memset(attribute_it->pValue + *attribute_it->pLen, 0, attribute_it->maxLen - *attribute_it->pLen);
// Set value attribute settings
attribute_it->settings = 0;
if (properties & READ_PROPERTY) {
attribute_it->settings = ATTS_SET_READ_CBACK;
attribute_it->settings |= ATTS_SET_READ_CBACK;
}
if (properties & WRITABLE_PROPERTIES) {
attribute_it->settings |= ATTS_SET_WRITE_CBACK;