Bluetooth mouse

Vladimir Grebenschikov vova at fbsd.ru
Sun Dec 19 23:22:37 PST 2004


В вс, 19/12/2004 в 18:35 -0800, Maksim Yevmenkin пишет:
> Vladimir,

> > # cat /var/db/bthidd.hids
> > 00:07:61:17:9b:27
> 
> hmmm... you did not hand-edit /var/db/bthidd.hids, did you? this file is 
>   not supposed to be edited by user. this file contains "hints" for 
> 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.
> 
> again if you hand-edited /var/db/bthidd.hids, then this is the correct 
> behavior. the typical behavior of bluetooth hid devices is: the very 
> first time bluetooth hid device needs to be contacted by the host. this 
> is because in its default state bluetooth hid device does not know 
> anything about host, i.e. its bd_addr etc. in its default state the hid 
> device will answer inquiry, etc. the host finds new hid device and 
> initiates bluetooth hid session (opens interrupt and control channels). 
> after the hid device was contacted by the host for the very first time, 
> the hid device will "remember" host bd_addr. after that bluetooth hid 
> device will reject all connection attempts from the different hosts and 
> may even stop responding to inquires.

I see.

> 0) run hcidump -w mouse.dump as root
> 
> 1) make sure bthidd(8) is NOT running
> 
> 2) reset the mouse (press reset button or disconnect batteries for a few 
> seconds)
> 
> 3) use bthidcontrol(8) to query the mouse
> 
> 4) put output of the bthidcontrol(8) in the /etc/bluetooth/bthidd.conf
> 
> 5) make sure mouse bd_addr IS *NOT* in the /var/db/bthidd.hids
> 
> 6) (OPTIONAL) *if* your mouse requests authentication then edit 
> /etc/bluetooth/hcsecd.conf file and add pin code or link key. the pin 
> 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)
> 
> 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=1, reconnect_initiate=1)
bthidd[1398]: Could not connect to 00:07:61:17:9b:27. Socket is not connected (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=1, reconnect_initiate=1)
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) 
< 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 
> bring it back just move it and/or press the buttons. you do *NOT* need 
> to fiddle with bthidd(8) and or bthidcontrol(8) anymore. if you done 
> everything above and it still does not work then send me hcidump output.
> 
> NOTE: if your have reset your mouse or replaced batteries you all you 
> need to do is: use 'bthidcontrol forget' command and restart bthidd(8).

> thanks,
> max
-- 
Vladimir B. Grebenchikov
vova at fbsd.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mouse.dump
Type: application/octet-stream
Size: 285 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-bluetooth/attachments/20041220/22159cb3/mouse.obj


More information about the freebsd-bluetooth mailing list