Make sure to reset settings before applying the properties

pull/10418/head
Marc Emmers 2019-04-16 16:25:24 +02:00
parent 0b7d9af4dd
commit d11cf287ac
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); memset(attribute_it->pValue + *attribute_it->pLen, 0, attribute_it->maxLen - *attribute_it->pLen);
// Set value attribute settings // Set value attribute settings
attribute_it->settings = 0;
if (properties & READ_PROPERTY) { if (properties & READ_PROPERTY) {
attribute_it->settings = ATTS_SET_READ_CBACK; attribute_it->settings |= ATTS_SET_READ_CBACK;
} }
if (properties & WRITABLE_PROPERTIES) { if (properties & WRITABLE_PROPERTIES) {
attribute_it->settings |= ATTS_SET_WRITE_CBACK; attribute_it->settings |= ATTS_SET_WRITE_CBACK;