projects
/
platform
/
upstream
/
bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a764cc1
)
shared/gatt-db: Allow passing NULL to gatt_db_attribute_write
author
Luiz Augusto von Dentz
<luiz.von.dentz@intel.com>
Thu, 8 Dec 2022 01:21:02 +0000
(17:21 -0800)
committer
Ayush Garg
<ayush.garg@samsung.com>
Fri, 5 Jan 2024 10:11:34 +0000
(15:41 +0530)
This makes gatt_db_attribute_write to accept NULL as a func when
storing directly on the db itself.
src/shared/gatt-db.c
patch
|
blob
|
history
diff --git
a/src/shared/gatt-db.c
b/src/shared/gatt-db.c
index
75a3ff2
..
40659a9
100644
(file)
--- a/
src/shared/gatt-db.c
+++ b/
src/shared/gatt-db.c
@@
-2106,7
+2106,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) {
@@
-2169,7
+2169,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;
}