Diff between 99156a2444129c25892b9cf026d7beaebeea9b52 and 86980984dd9ddeffe8124d3b0193f5a2d4ad3605

Changed Files

File Additions Deletions Status
src/adapter.c +2 -2 modified
src/attrib-server.c +3 -5 modified
src/attrib-server.h +2 -1 modified

Full Patch

diff --git a/src/adapter.c b/src/adapter.c
index 6a7d7d7..e65780e 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -766,7 +766,7 @@ void btd_adapter_class_changed(struct btd_adapter *adapter, uint32_t new_class)
 	if (main_opts.attrib_server) {
 		/* Removes service class */
 		class[1] = class[1] & 0x1f;
-		attrib_gap_set(GATT_CHARAC_APPEARANCE, class, 2);
+		attrib_gap_set(adapter, GATT_CHARAC_APPEARANCE, class, 2);
 	}
 
 	emit_property_changed(connection, adapter->path,
@@ -788,7 +788,7 @@ void adapter_name_changed(struct btd_adapter *adapter, const char *name)
 					DBUS_TYPE_STRING, &name);
 
 	if (main_opts.attrib_server)
-		attrib_gap_set(GATT_CHARAC_DEVICE_NAME,
+		attrib_gap_set(adapter, GATT_CHARAC_DEVICE_NAME,
 				(const uint8_t *) name, strlen(name));
 }
 
diff --git a/src/attrib-server.c b/src/attrib-server.c
index 486dd83..e01235f 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -1399,12 +1399,11 @@ int attrib_db_del(uint16_t handle)
 	return 0;
 }
 
-int attrib_gap_set(uint16_t uuid, const uint8_t *value, int len)
+int attrib_gap_set(struct btd_adapter *adapter, uint16_t uuid,
+						const uint8_t *value, int len)
 {
 	uint16_t handle;
 
-	DBG("Deprecated function!");
-
 	/* FIXME: Missing Privacy and Reconnection Address */
 
 	switch (uuid) {
@@ -1418,6 +1417,5 @@ int attrib_gap_set(uint16_t uuid, const uint8_t *value, int len)
 		return -ENOSYS;
 	}
 
-	/* FIXME: Provide the adapter in next function */
-	return attrib_db_update(NULL, handle, NULL, value, len, NULL);
+	return attrib_db_update(adapter, handle, NULL, value, len, NULL);
 }
diff --git a/src/attrib-server.h b/src/attrib-server.h
index 1265bd1..fb7f285 100644
--- a/src/attrib-server.h
+++ b/src/attrib-server.h
@@ -30,7 +30,8 @@ int attrib_db_update(struct btd_adapter *adapter, uint16_t handle,
 					bt_uuid_t *uuid, const uint8_t *value,
 					int len, struct attribute **attr);
 int attrib_db_del(uint16_t handle);
-int attrib_gap_set(uint16_t uuid, const uint8_t *value, int len);
+int attrib_gap_set(struct btd_adapter *adapter, uint16_t uuid,
+						const uint8_t *value, int len);
 uint32_t attrib_create_sdp(uint16_t handle, const char *name);
 void attrib_free_sdp(uint32_t sdp_handle);
 guint attrib_channel_attach(GAttrib *attrib, gboolean out);