All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-users] bthid cvs question
@ 2003-12-09 17:28 Jeffrey Arbuckle
  2003-12-10  1:43 ` Marcel Holtmann
  0 siblings, 1 reply; 13+ messages in thread
From: Jeffrey Arbuckle @ 2003-12-09 17:28 UTC (permalink / raw)
  To: bluez-users


Hi,

I was wondering if anyone could direct me to the cleaned up bthid cvs code referenced
by Marcel Holtmann in this posting:

3 Dec 21:12     Marcel Holtmann     The future of Bluetooth HID

-Jeffrey Arbuckle




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

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

* Re: [Bluez-users] bthid cvs question
  2003-12-09 17:28 [Bluez-users] bthid cvs question Jeffrey Arbuckle
@ 2003-12-10  1:43 ` Marcel Holtmann
  2003-12-10  8:02   ` Olivier Bornet
  0 siblings, 1 reply; 13+ messages in thread
From: Marcel Holtmann @ 2003-12-10  1:43 UTC (permalink / raw)
  To: Jeffrey Arbuckle; +Cc: BlueZ Mailing List

Hi Jeffrey,

> I was wondering if anyone could direct me to the cleaned up bthid cvs code referenced
> by Marcel Holtmann in this posting:
> 
> 3 Dec 21:12     Marcel Holtmann     The future of Bluetooth HID

the code is in CVS under utils2/hid/ now.

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

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

* Re: [Bluez-users] bthid cvs question
  2003-12-10  1:43 ` Marcel Holtmann
@ 2003-12-10  8:02   ` Olivier Bornet
  2003-12-10 14:18     ` Marcel Holtmann
  0 siblings, 1 reply; 13+ messages in thread
From: Olivier Bornet @ 2003-12-10  8:02 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: bluez-users, bluez-devel

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

Hello,

> the code is in CVS under utils2/hid/ now.

And do you have some tips on how to use it. I have try without success.
I will be happy to switch from bthid to the hid from BlueZ.

Thanks, and good day.

		Olivier
-- 
Olivier Bornet                      http://www.smartdata.ch/
Olivier.Bornet@smartdata.ch         SMARTDATA SA
GPG key ID: C53D9218                CH Martigny/Lausanne

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [Bluez-users] bthid cvs question
  2003-12-10  8:02   ` Olivier Bornet
@ 2003-12-10 14:18     ` Marcel Holtmann
  2003-12-20 23:01       ` Florian Echtler
  0 siblings, 1 reply; 13+ messages in thread
From: Marcel Holtmann @ 2003-12-10 14:18 UTC (permalink / raw)
  To: Olivier Bornet; +Cc: BlueZ Mailing List, BlueZ Mailing List

Hi Olivier,

> > the code is in CVS under utils2/hid/ now.
> 
> And do you have some tips on how to use it. I have try without success.
> I will be happy to switch from bthid to the hid from BlueZ.

you need to install libs2 and I propose that you install it somewhere
else. For example with prefix /opt/bluetooth or so. After that you have
to tweak the Makefile.am files from utils2 to find the includes and the
library under that specific prefix. Compile it with the same prefix and
you get the bthid and hid2hci program. I will work on getting the config
part of libs2 and utils2 finished this weekend, so it will be easy to
install it with a different prefix and not breaking your current setup.

To use bthid you must make sure that uinput kernel module is loaded and
that you have /dev/input/uinput. Start "bthid -d" and you have the HID
server. Watch the syslog for connection events.

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

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

* Re: [Bluez-users] bthid cvs question
  2003-12-10 14:18     ` Marcel Holtmann
@ 2003-12-20 23:01       ` Florian Echtler
  2003-12-21  1:25         ` [Bluez-devel] " Marcel Holtmann
  0 siblings, 1 reply; 13+ messages in thread
From: Florian Echtler @ 2003-12-20 23:01 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Olivier Bornet, BlueZ Mailing List

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> you get the bthid and hid2hci program. I will work on getting the config
> part of libs2 and utils2 finished this weekend, so it will be easy to
> install it with a different prefix and not breaking your current setup.
Great work! Right now, I am typing this with my MS Bluetooth keyboard
and I haven't noticed any glitches so far (connecting to the devices
still is kind of a hassle, but I guess MS is to blame for that).

Just out of curiosity: whats the purpose of hid2hci? I confess that
reading its sources didn't help my understanding..

Final question: I patched the original bthid to allow me to control
xmms via the extra mouse/keyboard buttons. Would anyone be interested
if I ported this patch to the new bthid?

Yours, Florian
- -- 
Homo homini lupus.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (NetBSD)

iD8DBQE/5NTp7CzyshGvatgRAuPTAJ4pity3lU57O0/e4Qv41v94bvIiEgCgmCAG
zCPn+xhkDUoHS2TvmqtIyZM=
=Ll+m
-----END PGP SIGNATURE-----

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

* [Bluez-devel] Re: [Bluez-users] bthid cvs question
  2003-12-20 23:01       ` Florian Echtler
@ 2003-12-21  1:25         ` Marcel Holtmann
  2003-12-21 10:52           ` Florian Echtler
  2004-01-05 16:44           ` Steven Singer
  0 siblings, 2 replies; 13+ messages in thread
From: Marcel Holtmann @ 2003-12-21  1:25 UTC (permalink / raw)
  To: Florian Echtler; +Cc: Olivier Bornet, BlueZ Mailing List

Hi Florian,

> Great work! Right now, I am typing this with my MS Bluetooth keyboard
> and I haven't noticed any glitches so far (connecting to the devices
> still is kind of a hassle, but I guess MS is to blame for that).

this is easy to solve. The problem is that if we don't have the device
in our inquiry cache we use a pscan_rep_mode with the value 0x01 for
connection setup, but Microsoft uses 0x02 by default. To solve the
glitches with the initial connection is to do an inquiry first.

> Just out of curiosity: whats the purpose of hid2hci? I confess that
> reading its sources didn't help my understanding..

If you have a dongle with a CSR HID proxy firmware, you need this
utility to switch it from HID to HCI mode.

> Final question: I patched the original bthid to allow me to control
> xmms via the extra mouse/keyboard buttons. Would anyone be interested
> if I ported this patch to the new bthid?

Send it to the list. Have you tried hotkeys? Last time I have tested it
it works fine for me.

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-users] bthid cvs question
  2003-12-21  1:25         ` [Bluez-devel] " Marcel Holtmann
@ 2003-12-21 10:52           ` Florian Echtler
  2003-12-21 11:56             ` [Bluez-devel] " Marcel Holtmann
  2004-01-05 16:44           ` Steven Singer
  1 sibling, 1 reply; 13+ messages in thread
From: Florian Echtler @ 2003-12-21 10:52 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Olivier Bornet, BlueZ Mailing List

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> > and I haven't noticed any glitches so far (connecting to the devices
> > still is kind of a hassle, but I guess MS is to blame for that).
> this is easy to solve. The problem is that if we don't have the device
> in our inquiry cache we use a pscan_rep_mode with the value 0x01 for
> connection setup, but Microsoft uses 0x02 by default. To solve the
> glitches with the initial connection is to do an inquiry first.
Do you mean by "hcitool inq <mouseaddr>"? Still doesn't work..
I can't even l2ping the bloody rodent, it's either "Host is down"
or "Function not implemented" (WTF?). Is there a tried-and-true command
sequence to get a freshly powered up mouse connected?

> > Final question: I patched the original bthid to allow me to control
> > xmms via the extra mouse/keyboard buttons. Would anyone be interested
> > if I ported this patch to the new bthid?
> Send it to the list.
I will, after I have everything finally up and running..

> Have you tried hotkeys? Last time I have tested it
> it works fine for me.
Not yet - I'll have a look at it, thanks.

Yours, Florian
- -- 
Homo homini lupus.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (NetBSD)

iD8DBQE/5Xt37CzyshGvatgRAisuAJ0Uv2OVaYPUTOWTxBJpXJc87aZD3QCglRxL
7RGI5Gku0GNDPMAq5J5aTiw=
=tt6X
-----END PGP SIGNATURE-----

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

* [Bluez-devel] Re: [Bluez-users] bthid cvs question
  2003-12-21 10:52           ` Florian Echtler
@ 2003-12-21 11:56             ` Marcel Holtmann
  2003-12-21 12:48               ` Florian Echtler
  0 siblings, 1 reply; 13+ messages in thread
From: Marcel Holtmann @ 2003-12-21 11:56 UTC (permalink / raw)
  To: Florian Echtler; +Cc: Olivier Bornet, BlueZ Mailing List

Hi Florian,

> Do you mean by "hcitool inq <mouseaddr>"? Still doesn't work..
> I can't even l2ping the bloody rodent, it's either "Host is down"
> or "Function not implemented" (WTF?). Is there a tried-and-true command
> sequence to get a freshly powered up mouse connected?

you only have to connect to a Bluetooth mouse once. In all subsequent
cases the mouse will connect to you. For the first connection you press
the connect button under the mouse. Run "hcitool inq" and connect to the
mouse. This is working every time.

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-users] bthid cvs question
  2003-12-21 11:56             ` [Bluez-devel] " Marcel Holtmann
@ 2003-12-21 12:48               ` Florian Echtler
  2003-12-21 13:14                 ` [Bluez-devel] " Marcel Holtmann
  0 siblings, 1 reply; 13+ messages in thread
From: Florian Echtler @ 2003-12-21 12:48 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Olivier Bornet, BlueZ Mailing List

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> you only have to connect to a Bluetooth mouse once. In all subsequent
> cases the mouse will connect to you. For the first connection you press
> the connect button under the mouse. Run "hcitool inq" and connect to the
> mouse. This is working every time.
Well, thanks for your reply - I've now found out where the problem
really was. I had simply enabled auth and encrypt in hcid.conf, and
AFAIK the MS devices are capable of none. Now they're working fine,
if only a bit insecure..

Thanks again, Yours, Florian
- -- 
Homo homini lupus.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (NetBSD)

iD8DBQE/5Za97CzyshGvatgRAr4aAKCXlPYQhMJyniwFVVliiw+14LezIwCfYOdA
n3rMwBpDYbp6pN5/CStOq80=
=BBk+
-----END PGP SIGNATURE-----

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

* [Bluez-devel] Re: [Bluez-users] bthid cvs question
  2003-12-21 12:48               ` Florian Echtler
@ 2003-12-21 13:14                 ` Marcel Holtmann
  0 siblings, 0 replies; 13+ messages in thread
From: Marcel Holtmann @ 2003-12-21 13:14 UTC (permalink / raw)
  To: Florian Echtler; +Cc: Olivier Bornet, BlueZ Mailing List

Hi Florian,

> Well, thanks for your reply - I've now found out where the problem
> really was. I had simply enabled auth and encrypt in hcid.conf, and
> AFAIK the MS devices are capable of none. Now they're working fine,
> if only a bit insecure..

don't worry about that, because the mouse uses relative coordinates and
so it will be a little bit hard to track your mouse moves without
knowing the origin. However I am pretty sure that you will notice the
protocol analyser if there is one ;)

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Re: [Bluez-users] bthid cvs question
  2003-12-21  1:25         ` [Bluez-devel] " Marcel Holtmann
  2003-12-21 10:52           ` Florian Echtler
@ 2004-01-05 16:44           ` Steven Singer
  2004-01-05 19:02             ` [Bluez-devel] " Marcel Holtmann
  1 sibling, 1 reply; 13+ messages in thread
From: Steven Singer @ 2004-01-05 16:44 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Florian Echtler, Olivier Bornet, BlueZ Mailing List

Marcel Holtmann wrote:
 > [Florian Echtler wrote:]
>>Great work! Right now, I am typing this with my MS Bluetooth keyboard
>>and I haven't noticed any glitches so far (connecting to the devices
>>still is kind of a hassle, but I guess MS is to blame for that).
> 
> this is easy to solve. The problem is that if we don't have the device
> in our inquiry cache we use a pscan_rep_mode with the value 0x01 for
> connection setup, but Microsoft uses 0x02 by default. To solve the
> glitches with the initial connection is to do an inquiry first.

A lot of devices use page scan repetition mode R2 by default as it's the
lowest power mode.

BlueZ's behaviour is wrong. If you do not know the page scan repetition
mode of the device you're going to connect to then you must use R2. The
1.1 spec does not state this explicitly, but it can be implied.

The wording has been tightened in the 1.2 spec, unfortunately, the note
is in the baseband spec so it's not surprising that host stack authors
miss it. Even then it's stated in a slightly unusual way. The BT 1.2
spec states in volume 2, part B, section 8.3.2, page 137:

   If the slave scan interval corresponds to R1, the repetition number is
   at least 128; if the slave scan interval corresponds to R2 or if the
   master has not previously read the slave's SR mode, the repetition
   number is at least 256. If the master has not previously read the
   slave's SR mode it shall use Npage >= 256.

[It looks like an erratum has been applied incorrectly as a point has
  been repeated - or maybe they wanted to stress it :-).]

The spec states that the master must use at least 256 repetitions if it
doesn't know the slave's SR mode and that this is the same as R2 mode.
However, the baseband doesn't know whether the master has read the
slave's SR mode. The baseband is told the slave's SR mode by the PSRM
parameter of the HCI_Create_Connection command and chooses an
appropriate number of repetitions. There isn't a PSRM parameter value
for "unknown SR mode". This implies that the only way to obey this part
of the spec is for the host to specify PSRM = 0x02 if it doesn't know
the SR mode of the slave.

The fastest way (on average) to connect to a device whose Bluetooth
address you know but whose SR mode you don't know is just to page it in
R2 mode. This is much faster than inquiring and then connecting with
the right parameters.

	- Steven
-- 



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

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

* Re: [Bluez-devel] bthid cvs question
  2004-01-05 16:44           ` Steven Singer
@ 2004-01-05 19:02             ` Marcel Holtmann
  2004-01-05 21:21               ` Steven Singer
  0 siblings, 1 reply; 13+ messages in thread
From: Marcel Holtmann @ 2004-01-05 19:02 UTC (permalink / raw)
  To: Steven Singer; +Cc: Florian Echtler, Olivier Bornet, BlueZ Mailing List

Hi Steven,

> A lot of devices use page scan repetition mode R2 by default as it's the
> lowest power mode.

the most device I have seen are using R1 by default and the only R2 are
my HID devices.

> BlueZ's behaviour is wrong. If you do not know the page scan repetition
> mode of the device you're going to connect to then you must use R2. The
> 1.1 spec does not state this explicitly, but it can be implied.

I am no baseband expert, so let me see if I understand you right. In the
case we don't know the page scan repetition mode we should use R2 in
prefer of R1 or even R0? Does this have disadvantages if the devices is
in R1 or R0 mode? I ask because we found that connecting with R1 by
default gives us a significant page time improvement.

If only R2 makes sense in case that we don't the exact value, somebody
should bring up an errata to the HCI working group ;)

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] bthid cvs question
  2004-01-05 19:02             ` [Bluez-devel] " Marcel Holtmann
@ 2004-01-05 21:21               ` Steven Singer
  0 siblings, 0 replies; 13+ messages in thread
From: Steven Singer @ 2004-01-05 21:21 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Florian Echtler, Olivier Bornet, BlueZ Mailing List

Marcel Holtmann wrote:
>>A lot of devices use page scan repetition mode R2 by default as it's the
>>lowest power mode.
> 
> the most device I have seen are using R1 by default and the only R2 are
> my HID devices.

Headsets can use R2. Basically any battery powered device that needs to
be connectable for long periods of time will be a candidate for using R2.

> I am no baseband expert, so let me see if I understand you right. In the
> case we don't know the page scan repetition mode we should use R2 in
> prefer of R1 or even R0? 

Correct.

 >                          Does this have disadvantages if the devices is
> in R1 or R0 mode? I ask because we found that connecting with R1 by
> default gives us a significant page time improvement.

The disadvantage of always using R2 is that you connect more slowly to
unknown devices than you might do if you used R1.

The advantage of using R2 is that you can connect to all devices. If you
use R1 then there may be many devices out there that you cannot connect
to (or that you connect to unreliably).

The worst case baseband connection times for different scenarios are:

slave sr \ master psrm  R0        R1        R2
R0                      0.20s     1.28s     2.56s
R1                      infinity  2.56s     3.84s
R2                      infinity  infinity  5.12s

> If only R2 makes sense in case that we don't the exact value, somebody
> should bring up an errata to the HCI working group ;)

The note from the baseband needs to be moved up to the HCI spec.

	- Steven
-- 



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

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

end of thread, other threads:[~2004-01-05 21:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-09 17:28 [Bluez-users] bthid cvs question Jeffrey Arbuckle
2003-12-10  1:43 ` Marcel Holtmann
2003-12-10  8:02   ` Olivier Bornet
2003-12-10 14:18     ` Marcel Holtmann
2003-12-20 23:01       ` Florian Echtler
2003-12-21  1:25         ` [Bluez-devel] " Marcel Holtmann
2003-12-21 10:52           ` Florian Echtler
2003-12-21 11:56             ` [Bluez-devel] " Marcel Holtmann
2003-12-21 12:48               ` Florian Echtler
2003-12-21 13:14                 ` [Bluez-devel] " Marcel Holtmann
2004-01-05 16:44           ` Steven Singer
2004-01-05 19:02             ` [Bluez-devel] " Marcel Holtmann
2004-01-05 21:21               ` Steven Singer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.