Diff between 1270afa5aa1cfa19927c3bce1b8f84dbe9f35a2f and b91d9213d951277896845830d0680061c7643828

Changed Files

File Additions Deletions Status
src/shared/gatt-db.c +9 -0 modified
src/shared/gatt-db.h +3 -0 modified

Full Patch

diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c
index 9a92090..b696fe3 100644
--- a/src/shared/gatt-db.c
+++ b/src/shared/gatt-db.c
@@ -1712,6 +1712,15 @@ uint16_t gatt_db_attribute_get_handle(const struct gatt_db_attribute *attrib)
 	return attrib->handle;
 }
 
+struct gatt_db_attribute *
+gatt_db_attribute_get_service(const struct gatt_db_attribute *attrib)
+{
+	if (!attrib)
+		return NULL;
+
+	return attrib->service->attributes[0];
+}
+
 bool gatt_db_attribute_get_service_uuid(const struct gatt_db_attribute *attrib,
 							bt_uuid_t *uuid)
 {
diff --git a/src/shared/gatt-db.h b/src/shared/gatt-db.h
index 41464ad..163a981 100644
--- a/src/shared/gatt-db.h
+++ b/src/shared/gatt-db.h
@@ -225,6 +225,9 @@ const bt_uuid_t *gatt_db_attribute_get_type(
 
 uint16_t gatt_db_attribute_get_handle(const struct gatt_db_attribute *attrib);
 
+struct gatt_db_attribute *
+gatt_db_attribute_get_service(const struct gatt_db_attribute *attrib);
+
 bool gatt_db_attribute_get_service_uuid(const struct gatt_db_attribute *attrib,
 							bt_uuid_t *uuid);