slow device discovery and inquiryCancel problem

47 views
Skip to first unread message

rnevet

unread,
Aug 26, 2008, 12:34:00 PM8/26/08
to bluecove-users
Well I'm hoping to get some help,

I developing a bluetooth Server-Clients appliaction.. it's based on
the server doing once in a while device discovery and then doing
service search on the RemoteDevices gathered.
I'm using BlueCove 2.0.2 and Windows stack. problem is that with some
time inquiry might take too much time .. more then 6 minutes.. it
might be even stuck, so I've added a timer on it and after the timeout
I'm calling cancelInquiry.

This doesn't help since cancelInquiry doesn't do what it's supposed to
do.. the effects are different between two computers that I use.. a
laptop with internal bluetooth it ignores the cancel request.. leaving
me waiting for the inquiry getting still the devicediscovered callback
until inquiry completes. On the other a computer with a BT dongel it
just stops.. and the inquiry never returns to the inquiryCompleted
callback.

I'm looking for a solution for this.. but I'm getting to think it
might not be solveable. I want to put this server as a stand alone.. I
don't want it to get stuck ;).. in the worst case I'll have to restart
the application.

Thanks.

Vlad Skarzhevskyy

unread,
Aug 26, 2008, 1:22:33 PM8/26/08
to bluecov...@googlegroups.com
If you want a robust server then you need to try Linux BlueZ.

As to "Microsoft stack will stuck in discovery" this may be the related to bluetooth  usb you are using. As to me I never have seen such problem using MS usb and D-Link DBT-120.

And yes the discovery can't be stopped in Microsoft stack. There are function to close handler WSALookupServiceEnd(). But does nothing.  See intelbth.cpp function cancelInquiry

rnevet

unread,
Aug 27, 2008, 4:28:53 PM8/27/08
to bluecove-users
I agree that the USB BT device that I'm using is apperantly causing
the problem.. it a noname shity one.

Researching this problem more.. I saw that actually sometimes the
inquiryCancel does return true.. (I guess this is in specific stages
of the inquiry).

I currently "solved" the problem of the very long device inquiry by
finding the Thread out of the threads by its name.. and calling Stop()
- deprecated command I know.. this causes the inquiryCompleted command
to return with Error.. but at least return.. I have tested this
solution further but... I will in the next few days.

Thanks for your response.


On 26 אוגוסט, 19:22, "Vlad Skarzhevskyy" <skarzhevs...@gmail.com>
wrote:
> --
> Vlad-הסתר טקסט מצוטט-
>
> -הראה טקסט מצוטט-

rnevet

unread,
Sep 11, 2008, 4:47:42 PM9/11/08
to bluecove-users
Hello vlad,

After testing some more I got to these weird conclusions:
1. cancelInquiry - returns true and false.. some times it does stop
the device inquiry and sometimes it just doesn't. if it fails and I
call it again it then gets stuck. it is really dependent of the timing
of the call.
2. cancelServiceSearch - the same behaviour.
3. The slow inquiry was the fault of my BT Device.. but this can also
happen if I'm in a very "busy" environment.

Do you have any recommendations on how to handle these functions? if
for example I want to stop my server.. and then restart it.

Thanks for your help.


On Aug 26, 7:22 pm, "Vlad Skarzhevskyy" <skarzhevs...@gmail.com>
wrote:
> --
> Vlad- Hide quoted text -
>
> - Show quoted text -

Vlad Skarzhevskyy

unread,
Sep 12, 2008, 7:10:14 AM9/12/08
to bluecov...@googlegroups.com
I already commented on our inability to control discovery process in
ms stack. see msdn for avalable api.
To get better unders5andin on hou things are working try running the
same jsr82 code on the phone or in emulator in other cases you woud
see a differences all described in wiki.

--
Sent from Gmail for mobile | mobile.google.com

Vlad

Reply all
Reply to author
Forward
0 new messages