L2CAP Problems

201 views
Skip to first unread message

JDes

unread,
Jun 5, 2015, 4:37:42 AM6/5/15
to btsta...@googlegroups.com
Hi, 

I get the Btstack on github and succeed to compile it on Linux with the libusb, I try to develop a development environment with two Linux machine equipped with BLE dongles each. One is running the l2cap-throughput example as server and the other as client. But the connection is seem so unstable and random. 

I get this differents issues : 

L2CAP connection to device 00:1b:dc:07:2e:69 failed. status code 4
L2CAP connection to device 00:1b:dc:07:2e:69 failed. status code 16
L2CAP connection to device 00:1b:dc:07:2e:69 failed. status code 101

I know status code 16 means "Connection terminated by the host".

Someone can tell me the meaning of the others status code (4 and 101) and why I can get a stable L2CAP connection.

Best Regards, 


Matthias Ringwald

unread,
Jun 5, 2015, 4:42:51 AM6/5/15
to btsta...@googlegroups.com
Hi JDes

Could you also post the full packet logs at /tmp/hci_dump.pklg from both machines. It's quick for me (and others) to look at them.

Status 4 is page timeout. that's just Bluetooth not being able to open a connection. maybe the other side wasn't started etc.
Status 101 is a BTstack error. See hci_cmds.h for them. 101 is L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_PSM, which means that the connection could be established but there wasn't an L2CAP service running on the request PSM.
 
best
  Matthias

--
You received this message because you are subscribed to the Google Groups "btstack-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
To post to this group, send email to btsta...@googlegroups.com.
Visit this group at http://groups.google.com/group/btstack-dev.
For more options, visit https://groups.google.com/d/optout.

JDes

unread,
Jun 5, 2015, 5:51:44 AM6/5/15
to btsta...@googlegroups.com
Thank you for your reply and your time. 

I not understand why i have the error ... I put some printf for the debug and i verify that's the other side was started before launch l2cap client. 

I join the log. 

BR, 
hci_dumpserver.pklg
hci_dumpclient.pklg

JDes

unread,
Jun 5, 2015, 9:38:21 AM6/5/15
to btsta...@googlegroups.com
hci_dumpclient.pklg
hci_dumpserver.pklg

Matthias Ringwald

unread,
Jun 5, 2015, 9:45:51 AM6/5/15
to btsta...@googlegroups.com
Hi BR

I cannot open the server log for some reason.

what irritates me is that there are commands before the HCI Reset. This might be a problem with the Client/Server communication, but I didn't see it before.

Could you try the examples in platforms/libusb to see if everything else is working fine?

best
matthias

--
You received this message because you are subscribed to the Google Groups "btstack-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
To post to this group, send email to btsta...@googlegroups.com.
Visit this group at http://groups.google.com/group/btstack-dev.
For more options, visit https://groups.google.com/d/optout.
<hci_dumpclient.pklg><hci_dumpserver.pklg>

JDes

unread,
Jun 8, 2015, 3:39:40 AM6/8/15
to btsta...@googlegroups.com
Hello, 

I try the examples in platforms/libusb but it doesn't work too .... I don't understand why :(.

I attach the log for the two PC with platforms/libusb examples. 

I will try today with others clean PC. 


Best Regards,

Jdes
hci_dump_PC2.pklg
hci_dump_PC1.pklg

Matthias Ringwald

unread,
Jun 8, 2015, 5:54:41 PM6/8/15
to btsta...@googlegroups.com
Hi Jdes

Thanks for the logs. The start up looks good. 
However, the l2cap connection starts while the stack is still booting up.

You should wait in your app with creating the l2cap connection until BTstack reports that it's ready, similar to the examples, like here:

Best
 Matthias





<hci_dump_PC2.pklg><hci_dump_PC1.pklg>

JDes

unread,
Jun 18, 2015, 5:27:48 AM6/18/15
to btsta...@googlegroups.com
Hi Matthias,

Sorry for the late, but I was trying to get it work, in your example your already test the ready state of the btstack. I try with other PC, I have the same problem. I don't understand why I got this issues.

Some times, I get a connection but in general I get nothing.

When you said I need to check the ready status, you mean this test : if (packet[2] == HCI_STATE_WORKING){

Best regdars,

Matthias Ringwald

unread,
Jun 18, 2015, 6:33:12 AM6/18/15
to btsta...@googlegroups.com
Hi JDes

no problem. yes, I refer to the check for the BTSTACK_EVENT_STATE event with and packet[2] == HCI_STATE_WORKING. it is only sent after the stack has fully bootet up. So the code to create an outgoing connection shouldn't start before that. I have no idea either what's going on. You may send more packet logs. You can look at them with Apple PacketLogger, and maybe with Wireshark. There seems to be a minor incompatibility with Wireshark, but I haven't figured it out yet.

Best
Matthias
Reply all
Reply to author
Forward
0 new messages