public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off
       [not found] <8712867d0608231353l6aa027bbha331a44392231f92@mail.gmail.com>
@ 2006-08-23 21:18 ` Jaime Alberto Silva
  2006-08-24  9:01   ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Jaime Alberto Silva @ 2006-08-23 21:18 UTC (permalink / raw)
  To: BlueZ users

I'm forwarding this message I recently posted to debian-bugs in order
to see if some of you know how to solve the problem:

---------- Forwarded message ----------
From: Jaime Alberto Silva <jaimealbertosilva@gmail.com>
Date: Aug 23, 2006 3:53 PM
Subject: bluez-utils: The inquiry scan (ISCAN) gets turned off
To: Debian Bug Tracking System <submit@bugs.debian.org>


Package: bluez-utils
Version: 3.1-3.1
Severity: important

Whenever I try to discover the local system (Debian computer) from a remote
system (mobile device, or other computer) it can't be found. After
some research I found out that the ISCAN mode is disabled:

--------------------------------------------------------------------
# hciconfig hci0
hci0:   Type: USB
        BD Address: 00:0E:6D:3B:31:AE ACL MTU: 192:8 SCO MTU: 64:8
        UP RUNNING PSCAN
        RX bytes:3190 acl:16 sco:0 events:208 errors:0
        TX bytes:1840 acl:17 sco:0 commands:105 errors:0
--------------------------------------------------------------------

But according to my hcid.conf file it should be enabled by default for
all devices, I'm using the prepackaged hcid.conf :

--------------------------------------------------------------------
# cat /etc/bluetooth/hcid.conf
#
# HCI daemon configuration file.
#

# HCId options
options {
        # Automatically initialize new devices
        autoinit yes;

        # Security Manager mode
        #   none - Security manager disabled
        #   auto - Use local PIN for incoming connections
        #   user - Always ask user for a PIN
        #
        security auto;

        # Pairing mode
        #   none  - Pairing disabled
        #   multi - Allow pairing with already paired devices
        #   once  - Pair once and deny successive attempts
        pairing multi;

        # Default PIN code for incoming connections
        passkey "1234";
}

# Default settings for HCI devices
device {
        # Local device name
        #   %d - device id
        #   %h - host name
        name "%h-%d";

        # Local device class
        class 0x3e0100;

        # Default packet type
        #pkt_type DH1,DM1,HV1;

        # Inquiry and Page scan
        pscan enable; iscan enable;

        # Default link mode
        #   none   - no specific policy
        #   accept - always accept incoming connections
        #   master - become master on incoming connections,
        #            deny role switch on outgoing connections
        lm accept;

        # Default link policy
        #   none    - no specific policy
        #   rswitch - allow role switch
        #   hold    - allow hold mode
        #   sniff   - allow sniff mode
        #   park    - allow park mode
        lp rswitch,hold,sniff,park;
}
--------------------------------------------------------------------

In an effort to make the Debian computer visible to other devices
I'm running the following command:

--------------------------------------------------------------------
# hciconfig hci0 piscan
# hciconfig hci0
hci0:   Type: USB
        BD Address: 00:0E:6D:3B:31:AE ACL MTU: 192:8 SCO MTU: 64:8
        UP RUNNING PSCAN ISCAN
        RX bytes:3294 acl:16 sco:0 events:221 errors:0
        TX bytes:1878 acl:17 sco:0 commands:112 errors:0
--------------------------------------------------------------------

But after a while the ISCAN mode gets disabled and I must keep running
hciconfig to make the computer visible again.

I have tried with two USB-BLUETOOTH dongles of different brands
and the problem persists.

I have also tried it in sid and etch with the same results.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-k7
Locale: LANG=es_CO, LC_CTYPE=es_CO (charmap=ISO-8859-1)

Versions of packages bluez-utils depends on:
ii  libbluetooth2                3.1-1       Library to use the BlueZ Linux Blu
ii  libc6                        2.3.6-18    GNU C Library: Shared libraries
ii  libdbus-1-2                  0.62-4      simple interprocess messaging syst
ii  libdbus-glib-1-2             0.62-4      simple interprocess messaging syst
ii  libglib2.0-0                 2.10.3-3    The GLib library of C routines
ii  libusb-0.1-4                 2:0.1.12-2  userspace USB programming library
ii  lsb-base                     3.1-12      Linux Standard Base 3.1 init scrip
ii  makedev                      2.3.1-82    creates device files in /dev
ii  module-init-tools            3.2.2-3     tools for managing Linux kernel mo
ii  modutils                     2.4.27.0-6  Linux module utilities
ii  sysvinit                     2.86.ds1-15 System-V-like init utilities
ii  udev                         0.093-1     /dev/ and hotplug management daemo

bluez-utils recommends no packages.

-- no debconf information


--
Jaime Alberto Silva       L I N U X       .~.
                                   The Choice     /V\
                                    of a GNU      / ( ) \
                                   Generation    ^^-^^

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

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

* Re: [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off
  2006-08-23 21:18 ` [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off Jaime Alberto Silva
@ 2006-08-24  9:01   ` Marcel Holtmann
  2006-08-24 13:46     ` Jaime Alberto Silva
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2006-08-24  9:01 UTC (permalink / raw)
  To: BlueZ users

Hi Jaime,

> Whenever I try to discover the local system (Debian computer) from a remote
> system (mobile device, or other computer) it can't be found. After
> some research I found out that the ISCAN mode is disabled:

this should have been fixed in bluez-utils-3.3. You have to set the
discoverable timeout to 0 and the mode to "discoverable" over the new
D-Bus API and then it will stay visible forever. Otherwise it goes back
to being non-discoverable after the discoverable timeout.

Regards

Marcel



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

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

* Re: [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off
  2006-08-24  9:01   ` Marcel Holtmann
@ 2006-08-24 13:46     ` Jaime Alberto Silva
  2006-08-24 14:11       ` Johan Hedberg
  0 siblings, 1 reply; 6+ messages in thread
From: Jaime Alberto Silva @ 2006-08-24 13:46 UTC (permalink / raw)
  To: BlueZ users

Hi Marcel,

Thanks a lot for your help!

I still have some questions:

On 8/24/06, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Jaime,
>
> > Whenever I try to discover the local system (Debian computer) from a remote
> > system (mobile device, or other computer) it can't be found. After
> > some research I found out that the ISCAN mode is disabled:
>
> this should have been fixed in bluez-utils-3.3. You have to set the
> discoverable timeout to 0 and the mode to "discoverable" over the new
> D-Bus API and then it will stay visible forever. Otherwise it goes back
> to being non-discoverable after the discoverable timeout.
>

Is there any tool in bluez-utils to achieve that? or some new entries
in the hcid.conf? so it can be done in an init script.

-- 
Jaime Alberto Silva       L I N U X       .~.
                                   The Choice     /V\
                                    of a GNU      / ( ) \
                                   Generation    ^^-^^

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

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

* Re: [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off
  2006-08-24 13:46     ` Jaime Alberto Silva
@ 2006-08-24 14:11       ` Johan Hedberg
  2006-08-24 14:51         ` Jaime Alberto Silva
  0 siblings, 1 reply; 6+ messages in thread
From: Johan Hedberg @ 2006-08-24 14:11 UTC (permalink / raw)
  To: BlueZ users

On Thu, Aug 24, 2006, Jaime Alberto Silva wrote:
> Is there any tool in bluez-utils to achieve that? or some new entries
> in the hcid.conf? so it can be done in an init script.

Adding "discovto 0;" to hcid.conf should do the trick.

You can change the settings from the command line using dbus-send, but I 
don't think it's a good idea to put it into a init script. E.g. the 
following would put the device in discoverable mode:
dbus-send --system --dest=org.bluez /org/bluez/hci0 \
	org.bluez.Adapter.SetMode string:discoverable

Johan

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

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

* Re: [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off
  2006-08-24 14:11       ` Johan Hedberg
@ 2006-08-24 14:51         ` Jaime Alberto Silva
  2006-08-24 20:31           ` Johan Hedberg
  0 siblings, 1 reply; 6+ messages in thread
From: Jaime Alberto Silva @ 2006-08-24 14:51 UTC (permalink / raw)
  To: BlueZ users

On 8/24/06, Johan Hedberg <johan.hedberg@nokia.com> wrote:
> On Thu, Aug 24, 2006, Jaime Alberto Silva wrote:
> > Is there any tool in bluez-utils to achieve that? or some new entries
> > in the hcid.conf? so it can be done in an init script.
>
> Adding "discovto 0;" to hcid.conf should do the trick.
>
> You can change the settings from the command line using dbus-send, but I
> don't think it's a good idea to put it into a init script. E.g. the
> following would put the device in discoverable mode:
> dbus-send --system --dest=org.bluez /org/bluez/hci0 \
>         org.bluez.Adapter.SetMode string:discoverable
>

Can you, please, point me to some documentation about dbus usage and
how to discover the methods registered by bluez?. Another example will
be nice, something like... How to set the discover timeout with dbus
;^)

Thanks for your help!

-- 
Jaime Alberto Silva       L I N U X       .~.
                                   The Choice     /V\
                                    of a GNU      / ( ) \
                                   Generation    ^^-^^

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

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

* Re: [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off
  2006-08-24 14:51         ` Jaime Alberto Silva
@ 2006-08-24 20:31           ` Johan Hedberg
  0 siblings, 0 replies; 6+ messages in thread
From: Johan Hedberg @ 2006-08-24 20:31 UTC (permalink / raw)
  To: BlueZ users

On Thu, Aug 24, 2006, Jaime Alberto Silva wrote:
> Can you, please, point me to some documentation about dbus usage and
> how to discover the methods registered by bluez?.

You can find a description of the bluez D-Bus API in the 
hcid/dbus-api.txt file that comes along with bluez-utils (you'll have to 
use version 3.3 since it wasn't included before that).

About D-Bus usage, well, by googling you should be able to find several 
places with some documentation, though I have to admit that some of the 
higher level bindings lack good documentation. E.g. the lowlevel API 
description can be found here:
http://dbus.freedesktop.org/doc/api/html/group__DBus.html

If you want to specifically use the bluez D-Bus API you could e.g. take 
a look at the source code of the new bluez-gnome package (which uses the 
GLib bindings of D-Bus) or the hcid/dbus-test script which is part of 
the bluez-utils package (it uses the python bindings and contains 
examples of pretty much every feature of the bluez D-Bus API).

> Another example will be nice, something like... How to set the 
> discover timeout with dbus

Set the discoverable timeout:
dbus-send --system --dest=org.bluez /org/bluez/hci0 \
	org.bluez.Adapter.SetDiscoverableTimeout uint32:100

Get the discoverable timeout:
dbus-send --system --dest=org.bluez --print-reply /org/bluez/hci0 \
	org.bluez.Adapter.GetDiscoverableTimeout

> Thanks for your help!

No problem :)

Johan

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <8712867d0608231353l6aa027bbha331a44392231f92@mail.gmail.com>
2006-08-23 21:18 ` [Bluez-users] Fwd: bluez-utils: The inquiry scan (ISCAN) gets turned off Jaime Alberto Silva
2006-08-24  9:01   ` Marcel Holtmann
2006-08-24 13:46     ` Jaime Alberto Silva
2006-08-24 14:11       ` Johan Hedberg
2006-08-24 14:51         ` Jaime Alberto Silva
2006-08-24 20:31           ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox