Once again about rfcomm.

47 views
Skip to first unread message

Norbert Lis

unread,
Sep 3, 2010, 5:16:36 PM9/3/10
to btsta...@googlegroups.com
Hi all,

So after few tries I have compiled code from example rfcomm into
xcode project. Anyway I have still problem with establish connection
to my PC. When I'm trying to connect windows is prompt for password
but after I type correct one connection is refused. Below is log.


Trying connection to 11-11-11-11-11-11 channel 1
unhandled event : 0f
Please enter PIN 0000 on remote device
unhandled event : 18
unhandled event : 61
unhandled event : 03
unhandled event : 1b
unhandled event : 13
unhandled event : 13
L2CAP connection to device 11-11-11-11-11-11 failed. status code 103

I assume that this unhandled events cause windows when trying to
retrieve bluetooth services. So I turn off pairing on windows side.
After that windows is not prompting for password anymore but
looks like rfcomm application on iphone still trying to use pairing.
How to turn it off?


Trying connection to 11-11-11-11-11-11 channel 1
unhandled event : 0f
Please enter PIN 0000 on remote device
L2CAP connection to device 11-11-11-11-11-11 failed. status code 34

What that all unhandled event means? Where I can get manual for
rfcomm protocol to fix that unhandled event?

Matthias is there any ETA when rfcomm support will be implemented in
BTstack?

Arthur Evstifeev

unread,
Sep 5, 2010, 3:34:02 AM9/5/10
to btstack-dev
Good day! May be i will be able to help you a little bit...

On 4 сен, 01:16, Norbert Lis <norbi1...@gmail.com> wrote:
> Hi all,
>
> So   after   few  tries  I have compiled code from example rfcomm into
> xcode  project.  Anyway I have still problem with establish connection
> to  my  PC.  When I'm trying to connect windows is prompt for password
> but after I type correct one connection is refused. Below is log.
>
> Trying connection to 11-11-11-11-11-11 channel 1
> unhandled event : 0f
> Please enter PIN 0000 on remote device
> unhandled event : 18
> unhandled event : 61
> unhandled event : 03
> unhandled event : 1b
> unhandled event : 13
> unhandled event : 13
> L2CAP connection to device 11-11-11-11-11-11 failed. status code 103
>
> I   assume   that  this  unhandled events cause windows when trying to
> retrieve  bluetooth  services.  So I turn off pairing on windows side.
> After   that  windows  is  not  prompting  for  password  anymore  but
> looks   like rfcomm application on iphone still trying to use pairing.
> How to turn it off?

Pairing in bluetooth made with event key, so you client have saved
link key and you didn`t. There is no link key logic in rfcomm example,
it only rejects link key request, so there is no complete pairing with
this example.

>
> Trying connection to 11-11-11-11-11-11 channel 1
> unhandled event : 0f
> Please enter PIN 0000 on remote device
> L2CAP connection to device 11-11-11-11-11-11 failed. status code 34
>
> What   that   all   unhandled  event means?

Unhandled event from only 1 thing... you didn`t handled it in packcage
handle. This messages don`t mean that you have error. They say to you
to look in hci specification (or in hci_cmds.h) for the event code and
maybe this hci events will be required for your application. For
example, unhandled event : 18 means HCI_EVENT_LINK_KEY_NOTIFICATION
event.

> Where I can get manual for rfcomm protocol to fix that unhandled event?
There is good book link in rfcomm wiki, but whole specification
consists of TS07.10 specification (can be found in google) and some
explanation for rfcomm over TS07.10 from bluetooth.org.

For you main problem i recommend you to have i look in hci pklg log.
It can be found in /tmp on you phone. There are much more information
there, so you will be able to solve this problem. As i can see there
is no l2cap connection request in first case, it may be also result of
sdp (as you think) and may be not, in second case i can see only hci
timeout rejection, so without pklg file it hard to say how to solve
this problem.

Norbert Lis

unread,
Sep 5, 2010, 2:58:52 PM9/5/10
to Arthur Evstifeev
Hello Arthur,

Many thanks for your help. In attachment I'm sending requested file. I
will take a look into documentation. However link for RFCOMM Protocol
specification is not working.

hci_dump.pklg

Matthias Ringwald

unread,
Sep 6, 2010, 3:56:54 PM9/6/10
to btsta...@googlegroups.com
Hi Norbert

to enable/disable pairing from the BTstack side, you can use the hci_write_authentication_enable command (search in rfcomm.c for it) and use 0/1 in the call.

in your attached log, you get a connection error 0x22: from bluetooth spec 2.1

2.34 LMP RESPONSE TIMEOUT (0X22)
The LMP Response Timeout error code indicates that an LMP transaction failed to respond within the LMP response timeout.

I'm not sure, but I guess the pairing code is not answered on the remote site.

also, it seems like Bluetooth.com changes their links periodically. I've updated the RFCOMM wiki to only point to the main specification site.

Best
Matthias

> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To post to this group, send email to btsta...@googlegroups.com.
> To unsubscribe from this group, send email to btstack-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/btstack-dev?hl=en.
>
> <hci_dump.pklg>

Norbert Lis

unread,
Sep 7, 2010, 5:42:29 AM9/7/10
to Matthias Ringwald
Hi Matthias,

You have right pairing disable on client side didn't change anything.
Now I'm getting always:

Trying connection to 11-11-11-11-11-11 channel 1
unhandled event : 0f

unhandled event : 61
unhandled event : 03
unhandled event : 1b
unhandled event : 13
unhandled event : 13
L2CAP connection to device 11-11-11-11-11-11 failed. status code 103

So the only changes is that 0x18 HCI_EVENT_LINK_KEY_NOTIFICATION is
no longer appear.

That erros defined in hci_cmds.h means L2CAP_CONFIG_RESPONSE_RESULT_UNACCEPTABLE_PARAMS

How to solve it? Do I need to handle this events?

0x0f HCI_EVENT_COMMAND_STATUS
0x03 HCI_EVENT_CONNECTION_COMPLETE
0x1b HCI_EVENT_MAX_SLOTS_CHANGED
0x13 HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS

Thanks

> Hi Norbert

> Best
> Matthias


--
Pozdrowienia,
Norbert Lis

Matthias Ringwald

unread,
Sep 7, 2010, 6:39:59 AM9/7/10
to btsta...@googlegroups.com
Hi Norbert

Please attach an hci_dump.pklg - the program output will, in the best case, tell you that something went wrong, or that it failed to connect at all.
If it says "L2CAP_CONFIG_RESPONSE_RESULT_UNACCEPTABLE_PARAMS", then, well, the parameters are not liked by the remote side. You're connecting to a Windows PC right now?

Best
Matthias

Norbert Lis

unread,
Sep 7, 2010, 6:56:24 AM9/7/10
to Matthias Ringwald
Hi,

I'm sending requesting file in attachment. That's right I'm trying to
connect to Windows PC. I wrote simple client/server app for windows
based on rfcomm and I was able to send and receive data. So bluetooth
module and drivers works fine. I will ge grateful if you can help me.

> Hi Norbert

> Best
> Matthias


--
Pozdrowienia,
Norbert Lis

hci_dump.pklg

Matthias Ringwald

unread,
Sep 7, 2010, 7:52:56 AM9/7/10
to btsta...@googlegroups.com
HI

in this log, you get the error "Connection refused - no resources available". I don't know how to interpret this in your context. Do you have another device connected already? Maybe RFCOMM is only allowed with authentication? Maybe you can try to connect to another device and compare the dumps? (note: you can also configure BTdaemon to write out log in the format used by blueZ or a generic hexump style - see daemon.c for this)

best
Matthias

Norbert Lis

unread,
Sep 8, 2010, 3:28:18 PM9/8/10
to Matthias Ringwald
Hi Matthias,

I have tried on another PC and below it's log. Still no successful but
this time it seems that it's negotiating connection. Could you look on
this log and tell more. What that unidentified commands mean?

Trying connection to 11-11-11-11-11-11 channel 1
unhandled event : 0f
unhandled event : 61
unhandled event : 03
unhandled event : 1b
unhandled event : 13

Channel successfully opened: 11-11-11-11-11-11, handle 0x0c, psm 0x03, source cid 0x45, dest cid 0x40
Sending SABM #0
unhandled event : 74
unhandled event : 74
unhandled event : 13
Received RFCOMM unnumbered acknowledgement for channel 0 - multiplexer working
Sending UIH Parameter Negotiation Command
unhandled event : 74
??: address 0b, control 0f: 0B 0F 01 66
??: address 01, control 53: 01 53 01 9C
unhandled event : 13
unhandled event : 73
unhandled event : 73
unhandled event : 73
unhandled event : 73
unhandled event : 73
unhandled event : 71
unhandled event : 13
unhandled event : 61
Basebank connection closed, exit.

I tried to configure daemon.c to change write log format but
I have problem with compile btstack with 3.1.2 SDK. I remember that
older version of btstack was compiled by me without problem.

hci_dump.pklg

Matthias Ringwald

unread,
Sep 9, 2010, 2:14:03 PM9/9/10
to btsta...@googlegroups.com
Hi Norbert

I just checked your log, too.

In the first few tries, this happens:

[19:36:16.510] [RFCOMM SEND] UIH Modem status command COMMAND
[19:36:16.511] [HCI EVENT] Undecoded Event Type -
[19:36:16.511] [RFCOMM RECEIVE] UIH Modem status command COMMAND
[19:36:16.539] [RFCOMM RECEIVE] UIH Modem status command RESPONSE
...

what's missing is that rfcomm.c should send a UIH Modem status command RESPONSE. however, my quick & dirty code from last year doesn't do that. I'm sorry, but you can either try to fix this, or wait until I release the next version of BTstack that includes a full (more or less) RFCOMM implementation, which I hope to do this month - as I said before, this will come when my OBEX integration is done.

Best
Matthias

Reply all
Reply to author
Forward
0 new messages