Help Bluez/hcitool HCI cmd

746 views
Skip to first unread message

Claudio Bertoldo

unread,
Feb 18, 2011, 12:41:00 PM2/18/11
to btsta...@googlegroups.com
Dear all,
 
Please, could anyone tell me how to connect to a bluetooth device through hcitool (BlueZ) hci command. Like this: "hcitool cmd 0x01 0x0005 [parameters]". How can I input this cmd? Is the [parameters] a bt device MAC adress like XX:XX:XX:XX:XX:XX?
 
I've tryed to use "hcitool cc <MAC>", but it doesn't work for me cause it disconnects the device a second later.
 
Thanks in advance.
 
Regards,
 
Claudio Bertoldo

Matthias Ringwald

unread,
Feb 18, 2011, 2:00:25 PM2/18/11
to btstack-dev
Hi Claudio

I would suggest to ask the bluez user mailing list :)

although I don't know bluez, I suspect that bluez will drop your just opened Bluetooth connection after a short time because there isn't a valid L2CAP connection on top of it. At least, that's what BTstack would do - after 5 seconds if I remember correctly.

Why do you want to open a baseband connection? You cannot use it from user space anyway. You can open an L2CAP connection e.g. with the bluez api or some wrappers, e.g. lightblue (python).

best
matthias

> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To post to this group, send email to btsta...@googlegroups.com.
> To unsubscribe from this group, send email to btstack-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/btstack-dev?hl=en.

Claudio Bertoldo

unread,
Feb 21, 2011, 7:42:22 AM2/21/11
to btsta...@googlegroups.com
Hi Matthias
 
 
I'm gonna try to get a solution there, thank you for ur suggestion.
 
You're right, the connection drop because there isn't an active L2CAP (or another) connection.
My goal is to measure the device´s RSSI without a active service. When I connect to device and explore their files, I get to measure. That occurs cause the cmd "hcitool cc XX:XX:XX:XX:XX:XX" makes a connection, verifies if a service starts: if yes the connection continues, but if not, it drops the connection and the measurement of RSSI isn't a service...
 
Best,
 
Claudio

Matthias Ringwald

unread,
Feb 23, 2011, 1:52:56 PM2/23/11
to btsta...@googlegroups.com
Hi Claudio,

to get the RSSI of other devices, you don't need to  open a baseband connection. You'll also get RSSI readings during an inquiry. You can try example/inquiry.c which enables the extended inquiry with RSSI readings.

Matthias (Gmail)

Sent with Replies
http://repliesapp.com

Matthias Ringwald

unread,
Mar 21, 2011, 3:30:04 PM3/21/11
to btsta...@googlegroups.com
Hi Claudio

I don't know what's your project, but if you only need some RSSI values, you can use the inquiry with RSSI results for that. see example/inquiry.c

Best
matthias
Reply all
Reply to author
Forward
0 new messages