Skip to contentSkip to conversation

BondingRemoved signal

PATCH In review Claudio Takahasi 2 participants 2 messages Feb 22, 2006 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 BondingRemoved signal

Hi Marcel,

here is the patch to send the BondingRemoved signal. Considering that we will need review the condition to send the signal I put a tag "FIXME:" to track this issue, but feel free to remove if you think that this is not relevant.

Regards,
Claudio.
--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT

Index: hcid/dbus-device.c
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus-device.c,v retrieving revision 1.7

dbus-device.c +12 -0
diff -u -r1.7 dbus-device.c
@@ -792,8 +792,10 @@
 static DBusMessage* handle_dev_remove_bonding_req(DBusMessage *msg, void *data)
 {
 	struct hci_dbus_data *dbus_data = data;
+	DBusConnection *connection = get_dbus_connection();
 	DBusMessageIter iter;
 	DBusMessage *reply;
+	DBusMessage *signal;
 	char filename[PATH_MAX + 1];
 	char addr[18], *addr_ptr;
 	struct hci_conn_info_req *cr;
@@ -813,6 +815,16 @@
 
 	/* Delete the link key from storage */
 	textfile_del(filename, addr_ptr);
+	
+	/* FIXME: which condition must be verified before send the signal */
+	signal = dev_signal_factory(dbus_data->dev_id, DEV_SIG_BONDING_REMOVED,
+						DBUS_TYPE_STRING, &addr_ptr,
+						DBUS_TYPE_INVALID);
+	if (signal) {
+		dbus_connection_send(connection, signal, NULL);
+		dbus_connection_flush(connection);
+		dbus_message_unref(signal);
+	}
 
 	str2ba(addr_ptr, &bdaddr);
 
maintainer
#1 lore raw

Hi Claudio,

Quoted 4 lines

here is the patch to send the BondingRemoved signal. Considering that we will need review the condition to send the signal I put a tag "FIXME:" to track this issue, but feel free to remove if you think that this is not relevant.

I moved the signal after the HCI disconnect command.

Regards

Marcel

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel