2005-09-30 16:40:31

by Robert Wlaschin

[permalink] [raw]
Subject: RE: [Bluez-devel] Trouble communicating to a non-discoverable BT device

Hi,

Sorry I posted this to the Bluez-user list but I think that was the wrong
place.

I have a slightly different problem than what I've seen posted in the
mailing list thus far, please point me in the right direction if I have
misspoke. I am attempting to create an Ash script (on Busybox, Arm
processor -- uClib cross compile, Deb Kernel 2.6.10) w/ bluez-libs-2.19, and
bluez-utils-2.19. The system I am using is semi-embedded and has a limited
amount of space for various utilities.

My BT device is non-discoverable, I am unable to change this. Therefore, I
am forced to wait until I am signaled by the device to attempt a connection.
This device is also battery operated and the Manufacturer designed it to
conserve power by allowing only a minimal time slice for the device to link
with my system. Once I have a connection I have to read the data by sending
ACK's back across the device.

I was attempting to create a script that watched the system log messages
dumped by hcid and sdpd. I was able to create a script using rfcomm's bind
and connect, which allowed me to read from /dev/rfcomm0 but I was unable to
send without receiving a 'Host is down' error. I did some reading and it
was suggested that both the devices were setup as clients and this was why I
was receiving this message. Another suggestion was to use rfcomm's listen
to setup the device. I have attempted an implementation of that but I
receive a Disconnect extremely quickly and I am having difficulty detecting
when the listen connects to my device so I can extract the BT address and
other pertinent data.

First off am I even heading in the correct direction, should I use the
rfcomm listen command, instead of the connect? Is there an easier way to do
what I need to get done, using already created tools I don't know about? Do
I need to run the sdptool and add the SP interface? Where are the doc's
that explain how to use the rfcomm and sdptool utils -- the man pages have
various information/knowledge gaps?

Thanks,
Robert