CreatDevice signal should be emitted at function create_stored_device_from_profiles() in src/adapter.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi:
I found that at bluez CreatDevice signal is not emitted at function create_stored_device_from_profile() in src/adapter.c. 
That leads to system can not got the CreatDevice singal when the deivce is created though storage. The usage case is that, when I unplug the bluethooth usb dongle and then plug in again. System can not get the CreatDevice signal. So ConnMan can not handle the CreatDevice signal. 
I have created patch to bluez to fix the issue. Please review, any comments are welcome.
diff --git a/src/adapter.c b/src/adapter.c
index 44a93b1..c096375 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1867,6 +1867,7 @@ static void create_stored_device_from_profiles(char *key, char *value,
 	struct btd_device *device;
 	bdaddr_t dst;
 	char srcaddr[18], dstaddr[18];
+	const char *path;
 
 	ba2str(&adapter->bdaddr, srcaddr);
 
@@ -1877,6 +1878,12 @@ static void create_stored_device_from_profiles(char *key, char *value,
 	device = device_create(connection, adapter, key);
 	if (!device)
 		return;
+
+	path = device_get_path(device);
+	g_dbus_emit_signal(connection, adapter->path,
+				ADAPTER_INTERFACE, "DeviceCreated",
+				DBUS_TYPE_OBJECT_PATH, &path,
+				DBUS_TYPE_INVALID);
 
 	device_set_temporary(device, FALSE);
 	adapter->devices = g_slist_append(adapter->devices, device);
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux