airprakken
Posts: 2
Joined: Fri Mar 27, 2009 10:28 pm

Device not nearby?

Fri Mar 27, 2009 10:47 pm

I want to reliably know if a BT device is actually within range and available. I am testing with 2 XP systems, one MS stack, one WidComm stack, both on .NET 3.5. A BlackBerry Bold is the device which is coming and going. I am using NetworkScanner.exe provided with the SDK.

On WidComm XP: NetworkScanner can see the phone coming and going whether it is paired/bonded or not.

On MS stack XP: NetworkScanner can see the phone coming and going if the PC and the phone are NOT paired/bonded. However, when they are bonded, it always discovers the phone even when it is not turned on. Since I want to reliably know that it is not nearby or turned on, this is a problem.

Q1: Is the above the expected operation?

Q2: What is the recommended approach for ensuring the phone is not close and discoverable?

I could do this but have not yet tried it: See if it is bonded and on MS Stack, then unbond first and then scan again. Seems kind of ugly and hoping something better would work. Would scanning for services reliably tell me this?

Thanks

Randy

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Device not nearby?

Sat Mar 28, 2009 9:43 am

If the device is bonded it will show up when you make device discoveries even if it's not present. That is expected behaviour. The only way to really know if this is correct is to connect to it. Running a service discovery might do the trick too, but it's a more costly operation.

Regards,
Jonas

airprakken
Posts: 2
Joined: Fri Mar 27, 2009 10:28 pm

RE: Device not nearby?

Fri Apr 17, 2009 12:50 am

Thanks Jonas. I am now attempting to solve this and am slightly confused by your phrase "connect to it" in this case.

I assume that you do not mean "bond to it", because it is already bonded.

So, assuming you mean connect to a service provided by the device, that would have required a service discovery first, right? But you said to connect instead of running a service discovery.

So, there is clearly something I don't yet understand. I've been studying the examples and they seem to show doing service discovery before any connection.

Thanks

Randy

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Device not nearby?

Fri Apr 17, 2009 1:10 am

Look at the ObexFtpClient, it shows how to make a connection without a service discovery.

Regards,
Jonas

Return to “BlueTools”