linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez-devel] [DBUS]Cleanup
@ 2006-02-07 13:34 Claudio Takahasi
  2006-02-08  1:24 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Claudio Takahasi @ 2006-02-07 13:34 UTC (permalink / raw)
  To: bluez-devel

[-- Attachment #1: Type: text/plain, Size: 465 bytes --]

Hi Marcel,


This patch fix two issues:
1. Suppose a scenario where there more than one adapter attached. If
the user removes the default device, the hcid is not updating the
default!

2. The scan mode doesn't need be configured. It's already being
changed in the configure_device function in the main.c file.


Regards,
Claudio.

--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT

[-- Attachment #2: cleanup01.patch --]
[-- Type: text/x-patch, Size: 1199 bytes --]

--- bluez-utils-cvs.orig/hcid/dbus.c	2006-02-07 08:12:06.000000000 -0200
+++ bluez-utils-cvs-cleanup/hcid/dbus.c	2006-02-07 08:13:33.000000000 -0200
@@ -1057,10 +1057,8 @@
 
 	ret = unregister_device_path(path);
 
-	/* FIXME: If there are any devices left after this removal the default
-	 * device should be changed to one of them */
 	if (ret && default_dev == id)
-		default_dev = -1;
+		default_dev = hci_get_route(NULL);
 
 	return ret;
 }
@@ -1921,8 +1919,6 @@
 {
 	DBusMessage *reply = NULL;
 	struct hci_dbus_data *dbus_data = data;
-	struct hci_dev_info di;
-	struct hci_dev_req dr;
 	int sk = -1;
 
 	/* Create and bind HCI socket */
@@ -1941,18 +1937,6 @@
 		goto failed;
 	}
 
-	if (ioctl(sk, HCIGETDEVINFO, (void *) &di) >= 0 &&
-					!hci_test_bit(HCI_RAW, &di.flags)) {
-		dr.dev_id  = dbus_data->dev_id;
-		dr.dev_opt = SCAN_PAGE | SCAN_INQUIRY; /* piscan */
-		if (ioctl(sk, HCISETSCAN, (unsigned long) &dr) < 0) {
-			syslog(LOG_ERR, "Can't set scan mode on hci%d: %s (%d)",
-					dbus_data->dev_id, strerror(errno), errno);
-			reply = bluez_new_failure_msg(msg, BLUEZ_ESYSTEM_OFFSET + errno);
-			goto failed;
-		}
-	}
-
 	reply = dbus_message_new_method_return(msg);
 
 failed:

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Bluez-devel] [DBUS]Cleanup
  2006-02-07 13:34 [Bluez-devel] [DBUS]Cleanup Claudio Takahasi
@ 2006-02-08  1:24 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2006-02-08  1:24 UTC (permalink / raw)
  To: bluez-devel

Hi Claudio,

> This patch fix two issues:
> 1. Suppose a scenario where there more than one adapter attached. If
> the user removes the default device, the hcid is not updating the
> default!
> 
> 2. The scan mode doesn't need be configured. It's already being
> changed in the configure_device function in the main.c file.

the patch is applied to the CVS now.

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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-08  1:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-07 13:34 [Bluez-devel] [DBUS]Cleanup Claudio Takahasi
2006-02-08  1:24 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).