1

I am trying to get BLE dongle (Master) to connect with an embedded BLE device (slave), after which they can use L2CAP packets to communicate. Using Bluez 5.18 I can see the slave advertising with hcitool lescan and can connect with it with hcitool lecc. Next I would like to communicate with the slave by sending and receiving L2CAP packets. How can this be achieved? I have tried various options with l2test to do this but haven't succeeded. I have used

-V le_random address type

-M to specify that the dongle is the master

-J 65 to specify channel id of 0x41

-i hci1 to specify the dongle

The modes that I have tried are

-u connect and receive

-n connect and be silent

-r listen and receive

-w listen and send

When trying to connect I am getting Invalid arguments(22) error if I use a le_random address type. Otherwise it says the host is down(112). How can I communicate with L2CAP layer with BLE devices? Any help is greatly appreciated. Regards.

EarthLord
  • 111
  • 1
  • 4
  • Have you tried the #gatttool command? You might be able to achieve what you want with it. Take a look at this question: http://stackoverflow.com/questions/15657007/bluetooth-low-energy-listening-for-notifications-indications-in-linux and this question: http://stackoverflow.com/questions/17835469/using-bluetooth-low-energy-in-linux-command-line?lq=1 and see if they can help. – Youssif Saeed May 08 '14 at 07:38
  • @yousifsaeed, thanks for your answer. gatttool isn't appropriate for the experiment that I am conducting which requires to be able to send packets, after a connection is established. This fine control over the packets is needed so that the Link-Layer's performance in BLE can be measured. – EarthLord May 08 '14 at 11:29

2 Answers2

1

In order to use L2CAP over BLE, you can use l2test in Bluez with following options :

On Tx side:     l2test -V le_public -s bd_addr_of_destination
On Rx side:     l2test -V le_public -r
Quentin
  • 29
  • 6
-1

I have been using l2test successfully using the following commands

On Tx side:     l2test -O 675 -s bd_addr_of_destination
On Rx side:     l2test -I 675 -b 10000 -r     

If the device uses UART as transport, make sure to use highest supported baudrate to achieve best throughput. If the transport is USB, then a decent results of 180kB/s ~ 1.4Mbps can be achieved.

Bowdzone
  • 3,827
  • 11
  • 39
  • 52