Reputation: 111
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.
Upvotes: 1
Views: 3101
Reputation: 29
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
Upvotes: 1
Reputation: 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.
Upvotes: -1