[Pkg-bluetooth-maintainers] Bug#379401: ISCAN/PSCAN can't be enabled in hcid.conf

Chaskiel Grundman cg2v at andrew.cmu.edu
Sun Sep 24 21:38:09 UTC 2006


The problem is this code snippet in hcid/main.c:configure_device()

        /* Set scan mode */
         if (!read_device_mode(&di.bdaddr, mode, sizeof(mode))) {
                 if (!strcmp(mode, MODE_OFF))
                         device_opts->scan = SCAN_DISABLED;
                 else if (!strcmp(mode, MODE_CONNECTABLE))
                         device_opts->scan = SCAN_PAGE;
                 else if (!strcmp(mode, MODE_DISCOVERABLE)) {
                         /* Set discoverable only if timeout is 0 */
                         if (!get_discoverable_timeout(hdev))
                                 device_opts->scan = SCAN_PAGE | 
SCAN_INQUIRY;
                         else
                                 device_opts->scan = SCAN_PAGE;
                 }
         }


When the configuration is read from the files in /var (what useful purpose 
does this serve?) instead of /etc/bluetooth/hcid.conf, SCAN_INQUIRY is 
only set if the 'discovto' parameter is available and set to 0. (discovto 
can be set in hcid.conf's device section)

if you remove /var/lib/bluetooth/<local_bdaddr>/*, then the scan mode are 
set correctly the next time you start hcid, but after that, it breaks 
again unless discovto is available.




More information about the Pkg-bluetooth-maintainers mailing list