I'm very new to Linux and Bluetooth development, and I'm unsure of the difference between sudo hcitool lecc <bdaddr>
and sudo gatttool -b <dbaddr> -I
? I don't require any of the GATT services; I just want a connection between the two devices.
I'm looking at vaguely following this widely referred to tutorial, and am looking at adapting the cmd_lecc
method in Bluez /tools/hcitool.c, but I am unable to connect to my BLE device using hcitool lecc
.
When I connect using gatttool
, I am able to connect successfully, however using hcitool lecc
returns the error 'Could not create connection: Connection timed out', and no connection is made to the BLE device. However, running sudo hcitool con
to show active connections shows that there is one: 'Unknown handle 0 state 2 lm SLAVE'. If it's failing to make the connection, why is it then registering the connection as active in hcitool
?
My question therefore is threefold:
- What is the difference between the two commands?
- Would
gatttool
be suitable for my purpose, or should I work out what's not working withhcitool
(following something like this? - Why does
sudo hcitool lecc <bdaddr>
partially connect, even when it times out?
Many thanks.