From: Konrad Kieling <konrad.kieling@imperial.ac.uk>
To: BlueZ users <bluez-users@lists.sourceforge.net>
Subject: Re: [Bluez-users] hid keyboard events get lost
Date: Mon, 28 May 2007 13:19:19 +0100 [thread overview]
Message-ID: <465AC8C7.1020502@imperial.ac.uk> (raw)
In-Reply-To: <4656FDE4.5070001@imperial.ac.uk>
[-- Attachment #1.1: Type: text/plain, Size: 10489 bytes --]
hello again,
just to let you know: the ``Freedom Universal Keyboard'' is working
perfectly now, after applying some minor tweaks to the kernel:
1. something to avoid the long negotiation for the mtu size, i commented
out the following lines in l2cap_build_conf_req
(net/bluetooth/l2cap.c):
// if (pi->imtu != L2CAP_DEFAULT_MTU)
// l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, pi->imtu);
yes i know, this might not be the way to go, but bt still works with
my mobile and the headset. maybe someone has an idea for a cleaner
solution?
2. unfortunately the data coming from the keyboard is missing the first
byte telling us about keyboard input. in hidp_input_report
(net/bluetooth/hidp/core.c) insert the following
lines after variable declaration:
if ( ( session->input->id.vendor == 0x045e ) &&
( session->input->id.product == 0x0403 ) )
{
for ( i = 7; i >= 0; i -- ) skb->data[i + 1] = skb->data[i];
skb->data[0] = 0x01;
}
again, is there a way to cope with this problem in a more generic
way?
ciao,
konrad
Konrad Kieling wrote:
> hi,
> i have some problems with getting the ``Freedom Universal Keyboard'' to
> work. after authentication the keyboard is automatically trying to
> connect to my computer. however, the connections never work. heres is
> the output of ``hcidump -V'' (using bluez-utils-3.10.1 and kernel
> 2.6.16.13):
> > HCI Event: Connect Request (0x04) plen 10
> bdaddr 00:0B:0D:85:30:0B class 0x002540 type ACL
> < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
> bdaddr 00:0B:0D:85:30:0B role 0x01
> Role: Slave
> .
> .
> .
> > ACL data: handle 42 flags 0x02 dlen 12
> L2CAP(s): Connect req: psm 17 scid 0x0040
> < ACL data: handle 42 flags 0x02 dlen 16
> L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
> Connection successful
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 42 packets 1
> > ACL data: handle 42 flags 0x02 dlen 16
> L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
> MTU 48
> < ACL data: handle 42 flags 0x02 dlen 14
> L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
> Success
> < ACL data: handle 42 flags 0x02 dlen 16
> L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
> MTU 48
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 42 packets 1
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 42 packets 1
> > ACL data: handle 42 flags 0x02 dlen 18
> L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 1 clen 4
> MTU 128
> < ACL data: handle 42 flags 0x02 dlen 16
> L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
> MTU 48
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 42 packets 1
> > ACL data: handle 42 flags 0x02 dlen 18
> L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 1 clen 4
> MTU 128
> < ACL data: handle 42 flags 0x02 dlen 12
> L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 42 packets 1
> > ACL data: handle 42 flags 0x02 dlen 12
> L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0040
> < HCI Command: Disconnect (0x01|0x0006) plen 3
> handle 42 reason 0x13
> Reason: Remote User Terminated Connection
> > HCI Event: Command Status (0x0f) plen 4
> Disconnect (0x01|0x0006) status 0x00 ncmd 1
> > HCI Event: Disconn Complete (0x05) plen 4
> status 0x00 handle 42 reason 0x16
> Reason: Connection Terminated by Local Host
>
>
> it seems to have problems in negotiating the mtu size. so i tried and
> commented out the lines in hidd which set the preferred mtu size,
> opts.imtu = HIDP_DEFAULT_MTU;
> opts.omtu = HIDP_DEFAULT_MTU;
>
> with this version of hidd the connection works perfectly, and even
> keystrokes are transferred, as can be seen in the hcidump:
> .
> .
> .
> > ACL data: handle 43 flags 0x02 dlen 12
> L2CAP(s): Connect req: psm 17 scid 0x0040
> < ACL data: handle 43 flags 0x02 dlen 16
> L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
> Connection successful
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 43 packets 1
> > ACL data: handle 43 flags 0x02 dlen 16
> L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
> MTU 48
> < ACL data: handle 43 flags 0x02 dlen 14
> L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
> Success
> < ACL data: handle 43 flags 0x02 dlen 16
> L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
> MTU 0
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 43 packets 1
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 43 packets 1
> > ACL data: handle 43 flags 0x02 dlen 14
> L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
> Success
> > ACL data: handle 43 flags 0x02 dlen 12
> L2CAP(s): Connect req: psm 19 scid 0x0041
> < ACL data: handle 43 flags 0x02 dlen 16
> L2CAP(s): Connect rsp: dcid 0x0041 scid 0x0041 result 0 status 0
> Connection successful
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 43 packets 1
> > ACL data: handle 43 flags 0x02 dlen 16
> L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 4
> MTU 48
> < ACL data: handle 43 flags 0x02 dlen 14
> L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 0
> Success
> < ACL data: handle 43 flags 0x02 dlen 16
> L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 4
> MTU 0
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 43 packets 1
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 43 packets 1
> > ACL data: handle 43 flags 0x02 dlen 14
> L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 0
> Success
> < ACL data: handle 43 flags 0x02 dlen 5
> L2CAP(d): cid 0x0040 len 1 [psm 17]
> HIDP: Set protocol: Boot protocol
> < ACL data: handle 43 flags 0x02 dlen 7
> L2CAP(d): cid 0x0041 len 3 [psm 19]
> HIDP: Data: Output report
> > ACL data: handle 43 flags 0x02 dlen 5
> L2CAP(d): cid 0x0040 len 1 [psm 17]
> HIDP: Handshake: Successful
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 43 packets 1
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 43 packets 1
> > HCI Event: Mode Change (0x14) plen 6
> status 0x00 handle 43 mode 0x02 interval 128
> Mode: Sniff
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > HCI Event: Mode Change (0x14) plen 6
> status 0x00 handle 43 mode 0x00 interval 0
> Mode: Active
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
> > ACL data: handle 43 flags 0x02 dlen 13
> L2CAP(d): cid 0x0041 len 9 [psm 19]
> HIDP: Data: Input report
>
>
> hcidump -X also shows, that the packets indeed contain keycodes.
> the device is correctly registered in /proc/bus/input/devices and in
> /sys/class/input/input4. however, the events never arrive in
> /dev/input/event4. the debugging messages of the hidp kernel module
> suggest, that they dont even arrive at this module:
> May 25 15:57:38 ed007 kernel: Bluetooth: HIDP (Human Interface
> Emulation) ver 1.1
> May 25 16:06:13 ed007 hidd[6345]: Bluetooth HID daemon
> May 25 16:06:24 ed007 hcid[5321]: link_key_request
> (sba=00:03:7A:F0:73:B5, dba=00:0B:0D:85:30:0B)
> May 25 16:06:24 ed007 hidd[6345]: New HID device 00:0B:0D:85:30:0B
> (Bluetooth Kbd)
> May 25 16:06:24 ed007 kernel: hidp_add_connection:
> May 25 16:06:24 ed007 kernel: __hidp_get_session:
> May 25 16:06:24 ed007 kernel: hidp_add_connection: ctrl mtu 0 intr
> mtu 0
> May 25 16:06:24 ed007 kernel: input: Bluetooth HID Boot Protocol
> Device as /class/input/input4
> May 25 16:06:24 ed007 kernel: __hidp_send_ctrl_message: session
> d972f640 data 00000000 size 0
> May 25 16:06:24 ed007 kernel: hidp_input_event: input d4a1e800 type 17
> code 0 value 0
> May 25 16:06:24 ed007 kernel: hidp_session: session d972f640
> May 25 16:06:24 ed007 kernel: hidp_process_transmit: session d972f640
> May 25 16:06:24 ed007 kernel: hidp_send_frame: sock db45bb40 data
> e4fab800 len 1
> May 25 16:06:24 ed007 kernel: hidp_send_frame: sock db45b840 data
> eca4ba00 len 3
> May 25 16:06:24 ed007 kernel: hidp_process_transmit: session d972f640
>
>
> does anyone have a clue why the events get lost on their way? or
> something on this mtu problem?
>
> thanks,
> konrad
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
next prev parent reply other threads:[~2007-05-28 12:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-25 15:16 [Bluez-users] hid keyboard events get lost Konrad Kieling
2007-05-28 12:19 ` Konrad Kieling [this message]
2007-05-28 13:55 ` Marcel Holtmann
2007-05-28 20:50 ` Konrad Kieling
2007-05-29 4:02 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=465AC8C7.1020502@imperial.ac.uk \
--to=konrad.kieling@imperial.ac.uk \
--cc=bluez-users@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox