Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Dec 2004 10:22:29 +0300
From:      Vladimir Grebenschikov <vova@fbsd.ru>
To:        Maksim Yevmenkin <maksim.yevmenkin@savvis.net>
Cc:        bluetooth@freebsd.org
Subject:   Re: Bluetooth mouse
Message-ID:  <1103527349.1024.18.camel@localhost>
In-Reply-To: <41C63A62.20304@savvis.net>
References:  <1100552998.1098.5.camel@localhost> <419B8353.7040908@savvis.net>     <opshmg45c1lo1qsj@mail.xs4all.nl> <419B9EF8.2090401@savvis.net>     <1103269957.974.7.camel@localhost> <41C32471.2050805@savvis.net> <866530fusa.fsf@kamino.rfc1149.org> <41C35B92.7080908@savvis.net> <1103489813.1721.14.camel@localhost> <41C63A62.20304@savvis.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-jxyyzihfbX3R7i+5jj7B
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

=F7 =D7=D3, 19/12/2004 =D7 18:35 -0800, Maksim Yevmenkin =D0=C9=DB=C5=D4:
> Vladimir,

> > # cat /var/db/bthidd.hids
> > 00:07:61:17:9b:27
>=20
> hmmm... you did not hand-edit /var/db/bthidd.hids, did you? this file is=20
>   not supposed to be edited by user. this file contains "hints" for=20
> bthidd(8), that is bluetooth hid devices "known" to bthidd(8).

Yes, I did. I've edited it while tried to make mouse works.

> > When I start bthidd it waits for mouse connection forever, clicking on =
mouse connect button does not seems to have any effect,
> > moreover hcidump does not show any traffic.
>=20
> again if you hand-edited /var/db/bthidd.hids, then this is the correct=20
> behavior. the typical behavior of bluetooth hid devices is: the very=20
> first time bluetooth hid device needs to be contacted by the host. this=20
> is because in its default state bluetooth hid device does not know=20
> anything about host, i.e. its bd_addr etc. in its default state the hid=20
> device will answer inquiry, etc. the host finds new hid device and=20
> initiates bluetooth hid session (opens interrupt and control channels).=20
> after the hid device was contacted by the host for the very first time,=20
> the hid device will "remember" host bd_addr. after that bluetooth hid=20
> device will reject all connection attempts from the different hosts and=20
> may even stop responding to inquires.

I see.

> 0) run hcidump -w mouse.dump as root
>=20
> 1) make sure bthidd(8) is NOT running
>=20
> 2) reset the mouse (press reset button or disconnect batteries for a few=20
> seconds)
>=20
> 3) use bthidcontrol(8) to query the mouse
>=20
> 4) put output of the bthidcontrol(8) in the /etc/bluetooth/bthidd.conf
>=20
> 5) make sure mouse bd_addr IS *NOT* in the /var/db/bthidd.hids
>=20
> 6) (OPTIONAL) *if* your mouse requests authentication then edit=20
> /etc/bluetooth/hcsecd.conf file and add pin code or link key. the pin=20
> code can be obtained from the mouse documentation. after that run hcsecd(=
8)
looks like it does not require key or pin, also winXP connects only without=
 pin.


> 7) start bthidd(8)
>=20
> if you did everything right the mouse should work.

Still no luck, but this time there is attempt to connect from host to mouse=
 on bthidd start:

# bthidd -d
bthidd[1398]: Opening outbound session for 00:07:61:17:9b:27 (new_device=3D=
1, reconnect_initiate=3D1)
bthidd[1398]: Could not connect to 00:07:61:17:9b:27. Socket is not connect=
ed (57)


There hcidump output while bthidd connection attempt
# hcidump -r mouse.dump
HCIDump - HCI packet analyzer ver 1.5
< HCI Command: Create Connection(0x01|0x0005) plen 13
> HCI Event: Command Status(0x0f) plen 4
> HCI Event: Connect Complete(0x03) plen 11
< HCI Command: Write Link Policy Settings(0x02|0x000d) plen 4
< ACL data: handle 0x002a flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 17 scid 0x0060
> HCI Event: Number of Completed Packets(0x13) plen 5
> HCI Event: Command Complete(0x0e) plen 6
> ACL data: handle 0x002a flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x005c scid 0x0060 result 1 status 2
> ACL data: handle 0x002a flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0000 scid 0x0060 result 2 status 0
> HCI Event: QoS Setup Complete(0x0d) plen 21
> HCI Event: Disconn Complete(0x05) plen 4
#

mouse.dump itself in attachment

also, after hardware reset by batteries, /var/db/bthidd.hids get address
of mouse, but do not write anything new to output and mouse still does
not work.


bthidd[1610]: Opening outbound session for 00:07:61:17:9b:27
(new_device=3D1, reconnect_initiate=3D1)
bthidd[1610]: Could not connect to 00:07:61:17:9b:27. Socket is not
connected (57)

hcidump while this is:

< HCI Command: Create Connection(0x01|0x0005) plen 13
> HCI Event: Command Status(0x0f) plen 4
> HCI Event: Connect Complete(0x03) plen 11
< HCI Command: Write Link Policy Settings(0x02|0x000d) plen 4
< ACL data: handle 0x0029 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 17 scid 0x006d
> HCI Event: Number of Completed Packets(0x13) plen 5
> HCI Event: Command Complete(0x0e) plen 6
> ACL data: handle 0x0029 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0042 scid 0x006d result 1 status 2
> ACL data: handle 0x0029 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0042 scid 0x006d result 0 status 0
< ACL data: handle 0x0029 flags 0x02 dlen 12
    L2CAP(s): Config req: dcid 0x0042 flags 0x0000 clen 0
> HCI Event: Number of Completed Packets(0x13) plen 5
> HCI Event: QoS Setup Complete(0x0d) plen 21
> ACL data: handle 0x0029 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x006d flags 0x0000 result 0 clen 0
> ACL data: handle 0x0029 flags 0x02 dlen 27
> ACL data: handle 0x0029 flags 0x01 dlen 13
    L2CAP(s): Config req: dcid 0x006d flags 0x0000 clen 28
    MTU 48 Unknown (type 03, len 22)=20
< ACL data: handle 0x0029 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0042 flags 0x0000 result 0 clen 0
< ACL data: handle 0x0029 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 25 scid 0x006e
> HCI Event: Number of Completed Packets(0x13) plen 5
> HCI Event: Number of Completed Packets(0x13) plen 5
> ACL data: handle 0x0029 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0000 scid 0x006e result 2 status 0
< ACL data: handle 0x0029 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0042 scid 0x006d
> HCI Event: Number of Completed Packets(0x13) plen 5
> ACL data: handle 0x0029 flags 0x02 dlen 12
    L2CAP(s): Disconn rsp: dcid 0x0042 scid 0x006d
< HCI Command: Disconnect(0x01|0x0006) plen 3
> HCI Event: Command Status(0x0f) plen 4
> HCI Event: Disconn Complete(0x05) plen 4

It happens when I disconnect/connect batteries and then press connect
button.

Even after that mouse does not moved.
if I restart bthidd - it does not connects and mouse does not send any
traffic.


> NOTE: the mouse will shutdown itself after some period of inactivity. to=20
> bring it back just move it and/or press the buttons. you do *NOT* need=20
> to fiddle with bthidd(8) and or bthidcontrol(8) anymore. if you done=20
> everything above and it still does not work then send me hcidump output.
>=20
> NOTE: if your have reset your mouse or replaced batteries you all you=20
> need to do is: use 'bthidcontrol forget' command and restart bthidd(8).

> thanks,
> max
--=20
Vladimir B. Grebenchikov
vova@fbsd.ru

--=-jxyyzihfbX3R7i+5jj7B
Content-Disposition: attachment; filename=mouse.dump
Content-Type: application/octet-stream; name=mouse.dump
Content-Transfer-Encoding: base64

EQAAANB3xkEiSAAAAQUEDSebF2EHABjMAQAAAAEHAAEA0HfGQf5fAAAEDwQAAQUEDgABANF3xkEC
oAoABAMLACoAJ5sXYQcAAQAIAAAA0XfGQQugCgABDQgEKgAPABEAAADRd8ZBDqAKAAIqIAwACAAB
AAIBBAARAGAACAABANF3xkEutwoABBMFASoAAQAJAAEA0XfGQcbGCgAEDgYBDQgAKgAVAAEA0XfG
QfZDCwACKiAQAAwAAQADAQgAXABgAAEAAgAVAAEA0XfGQdTICwACKiAQAAwAAQADAQgAAABgAAIA
AAAYAAEA0XfGQbVFDAAEDRUAKgAAAQAAAAAAAAAA8isAAP////8HAAEA0nfGQRtwAQAEBQQAKgAT



--=-jxyyzihfbX3R7i+5jj7B--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1103527349.1024.18.camel>