Diff between 8efc4e221f4a89e7cfe71bc10702d99279df7d42 and 9f115b331a6fc9bdb93b1c2c099bc9ef7ec5a02b

Changed Files

File Additions Deletions Status
src/adapter.c +8 -14 modified
src/hcid.h +0 -1 modified
src/main.c +0 -7 modified
src/main.conf +0 -3 modified

Full Patch

diff --git a/src/adapter.c b/src/adapter.c
index f4bb622..f9eb3af 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -811,6 +811,7 @@ static void set_pairable_timeout(struct btd_adapter *adapter,
 void btd_adapter_class_changed(struct btd_adapter *adapter, uint8_t *new_class)
 {
 	uint32_t class;
+	uint8_t cls[3];
 
 	class = new_class[0] | (new_class[1] << 8) | (new_class[2] << 16);
 
@@ -819,15 +820,11 @@ void btd_adapter_class_changed(struct btd_adapter *adapter, uint8_t *new_class)
 
 	adapter->dev_class = class;
 
-	if (main_opts.gatt_enabled) {
-		uint8_t cls[3];
+	memcpy(cls, new_class, sizeof(cls));
 
-		memcpy(cls, new_class, sizeof(cls));
-
-		/* Removes service class */
-		cls[1] = cls[1] & 0x1f;
-		attrib_gap_set(adapter, GATT_CHARAC_APPEARANCE, cls, 2);
-	}
+	/* Removes service class */
+	cls[1] = cls[1] & 0x1f;
+	attrib_gap_set(adapter, GATT_CHARAC_APPEARANCE, cls, 2);
 
 	g_dbus_emit_property_changed(btd_get_dbus_connection(), adapter->path,
 						ADAPTER_INTERFACE, "Class");
@@ -844,8 +841,7 @@ void adapter_name_changed(struct btd_adapter *adapter, const char *name)
 	g_dbus_emit_property_changed(btd_get_dbus_connection(), adapter->path,
 						ADAPTER_INTERFACE, "Name");
 
-	if (main_opts.gatt_enabled)
-		attrib_gap_set(adapter, GATT_CHARAC_DEVICE_NAME,
+	attrib_gap_set(adapter, GATT_CHARAC_DEVICE_NAME,
 				(const uint8_t *) name, strlen(name));
 }
 
@@ -2718,8 +2714,7 @@ gboolean adapter_init(struct btd_adapter *adapter, gboolean up)
 
 	sdp_init_services_list(&adapter->bdaddr);
 
-	if (main_opts.gatt_enabled)
-		btd_adapter_gatt_server_start(adapter);
+	btd_adapter_gatt_server_start(adapter);
 
 	load_config(adapter);
 	convert_device_storage(adapter);
@@ -2786,8 +2781,7 @@ void adapter_remove(struct btd_adapter *adapter)
 	g_slist_free(adapter->devices);
 
 	unload_drivers(adapter);
-	if (main_opts.gatt_enabled)
-		btd_adapter_gatt_server_stop(adapter);
+	btd_adapter_gatt_server_stop(adapter);
 
 	g_slist_free(adapter->pin_callbacks);
 
diff --git a/src/hcid.h b/src/hcid.h
index 1e5e15a..43a75fd 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -38,7 +38,6 @@ struct main_opts {
 	gboolean	reverse_sdp;
 	gboolean	name_resolv;
 	gboolean	debug_keys;
-	gboolean	gatt_enabled;
 
 	uint8_t		mode;
 
diff --git a/src/main.c b/src/main.c
index f8c9369..9ea12df 100644
--- a/src/main.c
+++ b/src/main.c
@@ -235,13 +235,6 @@ static void parse_config(GKeyFile *config)
 	else
 		main_opts.debug_keys = boolean;
 
-	boolean = g_key_file_get_boolean(config, "General",
-						"EnableGatt", &err);
-	if (err)
-		g_clear_error(&err);
-	else
-		main_opts.gatt_enabled = boolean;
-
 	main_opts.link_mode = HCI_LM_ACCEPT;
 
 	main_opts.link_policy = HCI_LP_RSWITCH | HCI_LP_SNIFF |
diff --git a/src/main.conf b/src/main.conf
index 787ef4f..aa59c82 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -59,6 +59,3 @@ NameResolving = true
 # makes debug link keys valid only for the duration of the connection
 # that they were created for.
 DebugKeys = false
-
-# Enable the GATT functionality. Default is false
-EnableGatt = false