Message ID | 20221209010314.707606-4-luiz.dentz@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | be9fc9222c033391329e6145ccf4e81dcfcf1934 |
Headers | show |
Series | [BlueZ,1/5] shared/att: Fix not requeueing in the same channel | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/CheckPatch | success | CheckPatch PASS |
tedd_an/GitLint | success | Gitlint PASS |
tedd_an/IncrementalBuild | success | Incremental Build PASS |
diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c index ba47c75ff70c..9a92090ec493 100644 --- a/src/shared/gatt-db.c +++ b/src/shared/gatt-db.c @@ -2095,7 +2095,7 @@ bool gatt_db_attribute_write(struct gatt_db_attribute *attrib, uint16_t offset, { uint8_t err = 0; - if (!attrib || !func) + if (!attrib || (!func && attrib->write_func)) return false; if (attrib->write_func) { @@ -2158,7 +2158,8 @@ bool gatt_db_attribute_write(struct gatt_db_attribute *attrib, uint16_t offset, memcpy(&attrib->value[offset], value, len); done: - func(attrib, err, user_data); + if (func) + func(attrib, err, user_data); return true; }
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> This makes gatt_db_attribute_write to accept NULL as a func when storing directly on the db itself. --- src/shared/gatt-db.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)