Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] shared/gatt-db: Expose gatt_db_attribute
@ 2014-10-24 13:48 Luiz Augusto von Dentz
  2014-10-24 16:56 ` Arman Uguray
  0 siblings, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2014-10-24 13:48 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This is just a draft API to reduce the lookups in gatt_db and make it
a little bit more convenient for batch operations, so the general idea
is to be able to get a hold of it via gatt_db_get_attribute but also
replace the handles in the queues with proper attributes so the server
code don't have to lookup again when reading/writing, checking
permissions, or any other operation that can be done directly.
---
 src/shared/gatt-db.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/shared/gatt-db.h b/src/shared/gatt-db.h
index 8d18434..ab7469a 100644
--- a/src/shared/gatt-db.h
+++ b/src/shared/gatt-db.h
@@ -96,3 +96,25 @@ bool gatt_db_get_service_uuid(struct gatt_db *db, uint16_t handle,
 
 bool gatt_db_get_attribute_permissions(struct gatt_db *db, uint16_t handle,
 							uint32_t *permissions);
+
+struct gatt_db_attribute;
+
+struct gatt_db_attribute *gatt_db_get_attribute(struct gatt_db *attrib,
+					uint16_t handle, uint16_t offset);
+
+const bt_uuid_t *gatt_db_attribute_get_type(struct gatt_db_attribute *attrib);
+
+bool gatt_db_attribute_get_service_uuid(struct gatt_db_attribute *attrib,
+							bt_uuid_t *uuid);
+
+bool gatt_db_attribute_get_permissions(struct gatt_db_attribute *attrib,
+							uint32_t *permissions);
+
+bool gatt_db_attribute_read(struct gatt_db_attribute *attrib,
+					uint8_t opcode, bdaddr_t *bdaddr,
+					void *callback, void *user_data);
+
+bool gatt_db_attribute_write(struct gatt_db_attribute *attrib,
+					const uint8_t *value, size_t len,
+					uint8_t opcode, bdaddr_t *bdaddr,
+					void *callback, void *user_data);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-26 21:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-24 13:48 [PATCH BlueZ] shared/gatt-db: Expose gatt_db_attribute Luiz Augusto von Dentz
2014-10-24 16:56 ` Arman Uguray
2014-10-26 18:48   ` Luiz Augusto von Dentz
2014-10-26 21:14     ` Arman Uguray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox