All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] Pairing fails with RFCOMM
@ 2004-02-06 17:03 Nils Faerber
  2004-02-06 19:57 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Nils Faerber @ 2004-02-06 17:03 UTC (permalink / raw)
  To: bluez-devel

Hi all!
I think I found a small problem with rfcomm concerning pairing.
The problem is that if you try to connect to a "new" device which
requires pairing using rfcomm you will be queried for y pin on both
sides. But it seems that a connect timeout in rfcomm is way too short
for being able to input the pin.
It happened to me while trying to connect to a Siemens S55 mobile.
I did a "rfcomm bind" and then opened minicom on the port. After that
the mobile requests the pin. But before you can even start to input the
pin minicom exits with an error.
If I start another connection first, like with multisync, the whole
connection process waits until the pin has been entered on both sides.

CU
  nils faerber

-- 
kernel concepts          Tel: +49-271-771091-12
Dreisbachstr. 24         Fax: +49-271-771091-19
D-57250 Netphen          D1 : +49-170-2729106
--



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Pairing fails with RFCOMM
  2004-02-06 17:03 [Bluez-devel] Pairing fails with RFCOMM Nils Faerber
@ 2004-02-06 19:57 ` Marcel Holtmann
       [not found]   ` <1076337219.2892.57.camel@localhost>
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2004-02-06 19:57 UTC (permalink / raw)
  To: Nils Faerber; +Cc: bluez-devel

Hi Nils,

> I think I found a small problem with rfcomm concerning pairing.
> The problem is that if you try to connect to a "new" device which
> requires pairing using rfcomm you will be queried for y pin on both
> sides. But it seems that a connect timeout in rfcomm is way too short
> for being able to input the pin.
> It happened to me while trying to connect to a Siemens S55 mobile.
> I did a "rfcomm bind" and then opened minicom on the port. After that
> the mobile requests the pin. But before you can even start to input the
> pin minicom exits with an error.
> If I start another connection first, like with multisync, the whole
> connection process waits until the pin has been entered on both sides.

there is a difference between "rfcomm bind ..." and "rfcomm conn ...",
because on the "bind" case the connection is established by the TTY part
of the RFCOMM layer. In the case of "connect" the socket is creating the
connection and MultiSync is using the socket. Please try to reproduce
this behaviour with only using the rfcomm program and cat instead of
minicom to trigger this behaviour. Please include the binary hcidump.

And the important thing, what kernel are you using?

Regards

Marcel




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Pairing fails with RFCOMM
       [not found]   ` <1076337219.2892.57.camel@localhost>
@ 2004-02-09 15:01     ` Marcel Holtmann
       [not found]       ` <1076339124.1169.67.camel@localhost>
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2004-02-09 15:01 UTC (permalink / raw)
  To: Nils Faerber; +Cc: bluez-devel

Hi Nils,

> It seems that minicom implements a timeout on open()ing the tty. This
> times out before the authentication took place. When using rfcomm
> connect first or using cat the connect works.
> So this is indeed not a BlueZ/RFCOMM problem, because IMHO there is no
> real way to fix it (only possible solution would be to always allow
> open()ing the port, paired or not, connected or not).

this is not really a solution, because it moves the detection of
Bluetooth connection errors out of the scope.

Regards

Marcel




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Pairing fails with RFCOMM
       [not found]       ` <1076339124.1169.67.camel@localhost>
@ 2004-02-09 15:08         ` Marcel Holtmann
       [not found]           ` <1076340484.1167.79.camel@localhost>
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2004-02-09 15:08 UTC (permalink / raw)
  To: Nils Faerber; +Cc: bluez-devel

Hi Nils,

> But maybe we should mention this in some FAQ. I guess that more programs
> than minicom will have some timeout logic like this and that other users
> might stumble accreoss the same problem sooner or later.

of course. Send me an entry for our FAQ and I'll add it.

Regards

Marcel




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Pairing fails with RFCOMM
       [not found]           ` <1076340484.1167.79.camel@localhost>
@ 2004-02-09 15:56             ` Marcel Holtmann
       [not found]               ` <1076342698.1167.90.camel@localhost>
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2004-02-09 15:56 UTC (permalink / raw)
  To: Nils Faerber; +Cc: bluez-devel

Hi Nils,

> OK, maybe like this:
> ----->
> xx. RFCOMM connection using minicom or other tool fails, why?
> Problem: In case you have created the RFCOMM link using the "rfcomm
> bind" function this can be caused by application timeouts. This is not a
> problem of BlueZ or the RFCOMM implementation but rather a problem with
> the different nature of a RFCOMM virtual tty and a physical serial tty
> device which is normally used by those applications. Some applications
> implement a timeout protection function while opening the port. If
> opening the port takes longer than a certain amount of time then the
> application fails. A serial tty will usually only take several
> microseconds to open while the RFCOMM virtual tty can take several
> seconds. Additionally opening requires to create a connection to the
> remote Bluetooth device, closing the port closes the connection again.
> Application which open and close the port frequently may thus also fail!
> Solution: Try to create the connection before starting you application.
> This can be done by the "rfcomm connect" function. The Bluetooth
> connection will then remain until the rfcomm utility is stopped.
> <-----
> 
> A bit lengthy maybe ;)

thank you. I stripped a little bit and put it only ;)

> How does BT-HID mouse work?

The best is you follow this HOWTO

	http://www.bueche.ch/comp/mx900/mx900.html

And don't use the bthid from Peter Klausler until you patch it up.

> I have a BT mouse here but the bthid daemon does not connect to it nor
> can I connect another service like rfcomm to it...

RFCOMM will never work, because HID is only based on L2CAP.

> The accompanied keyboard works like a charm!

If the keyboard works, the mouse should work also.

Regards

Marcel




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Pairing fails with RFCOMM
       [not found]               ` <1076342698.1167.90.camel@localhost>
@ 2004-02-09 16:14                 ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2004-02-09 16:14 UTC (permalink / raw)
  To: Nils Faerber; +Cc: bluez-devel

Hi Nils,

> This has already been solved, sorry for bothering.
> My problem was that bthid is not very verbose unless you look into the
> daemon-log - I did not :(
> So I did not see that it already had connected upon first try! All other
> tries after that failed of course.
> BTW: "bthid -l" did not show this connection so there is still some
> glitch...

I know, there is much more work to do ;)

> BTW: The dongle in use is the EPOX USB dongle from the
> keyboard-mouse-dongle package. Switching from HID to HCI also worked
> like a charm - well done!

Thanks. And even the Logitech dongle can be switched. Some Apple iBooks
should also work like this.

> Now I only have to figure out how to force the pairing on the keyboard.
> >From what I know it should work in a way that you can input the pin on
> the keyboard. But I can simply connect to it without authentication...

That is one of the problems that must be solved. If you read the HID
specification then you will see that the host stack is responsible for
doing the authentication. But you can't enable auth per se, because the
connection to a mouse must be done (the Apple mouse is the exception)
without authentication and encryption. So you must first identify the
type of the HID device. This can be done through the class of device
value on incoming connection, but we don't make this value accessable
from userspace in BlueZ. Or you use the HID descriptor and then issue a
HCI_Authenticate command if it is a keyboard.

Regards

Marcel






-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

end of thread, other threads:[~2004-02-09 16:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-06 17:03 [Bluez-devel] Pairing fails with RFCOMM Nils Faerber
2004-02-06 19:57 ` Marcel Holtmann
     [not found]   ` <1076337219.2892.57.camel@localhost>
2004-02-09 15:01     ` Marcel Holtmann
     [not found]       ` <1076339124.1169.67.camel@localhost>
2004-02-09 15:08         ` Marcel Holtmann
     [not found]           ` <1076340484.1167.79.camel@localhost>
2004-02-09 15:56             ` Marcel Holtmann
     [not found]               ` <1076342698.1167.90.camel@localhost>
2004-02-09 16:14                 ` Marcel Holtmann

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.