kalle122
Posts: 2
Joined: Mon Oct 22, 2007 5:41 pm

DeviceDiscovered finds device that is turned off

Mon Oct 22, 2007 5:57 pm

Hi,

i run the example obexpushclient. My phone is discoverd fine.

then i turn off bluetooth on my mobile and run it again.


Errors:
* my mobile is _still_ discoverd, and i get an exception when trying to discover services (since it has BT off)
* It seems that when i take my phone out of range it is not detected as Lost
* it is not redeteced when coming in range

Any sugestions? I am running XP sp2 with an K700i

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

RE: DeviceDiscovered finds device that is turned off

Mon Oct 22, 2007 6:09 pm

1. I guess the phone is bonded? Bonded devices are always discovered even if they are not present.
2. DeviceLost is not triggered just because you move out of range, it's triggered when you run a new device discovery.
3. Again, if you move into range and run a device discovery it will trigger.

Regards,
Jonas

kalle122
Posts: 2
Joined: Mon Oct 22, 2007 5:41 pm

RE: DeviceDiscovered finds device that is turned off

Thu Oct 25, 2007 2:31 pm

Hi Jonas,

Yes you wher correct, if i remove the bounding dicovery and lost are triggerd. Tanks.

This lead me to the following question. How do i determain if an bounded phone is in range or not?

Regarsd kalle

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

RE: DeviceDiscovered finds device that is turned off

Thu Oct 25, 2007 2:48 pm

The only want to know if a phone is present (in range, turned on etc.) is attempting to retrieve a connection (Stream) from it.

Regards,
Jonas

SPBU
Posts: 1
Joined: Fri Oct 10, 2008 11:53 pm

RE: DeviceDiscovered finds device that is turned off

Sat Oct 11, 2008 12:01 am

I just tried the ObexPushClient sample that comes with the download. I find that if I click on the Discover button a second time and trace the execution, it does not call the handler, "m_network_DeviceDiscovered". In other words, the search for devices fails unless it is the first call. The only reason there are still entries in the listbox is because it isn't being cleared on the second and subsequent calls. I don't want to restart my application I have in mind just to retry the search. Is there a workaround?

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

RE: DeviceDiscovered finds device that is turned off

Sat Oct 11, 2008 1:40 am

Network.Devices contains the cached devices.
There is no way to clear this cache (and get DeviceDiscovered events) at this time.

Regards,
Jonas

Return to “BlueTools”