0
votes

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.

1
Have you tried the #gatttool command? You might be able to achieve what you want with it. Take a look at this question: stackoverflow.com/questions/15657007/… and this question: stackoverflow.com/questions/17835469/… and see if they can help.Youssif Saeed
@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

1 Answers

-1
votes

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.