Bluetooth: constantly searches devices
Hi people!
I would like to ask if you could advice me a good bluetooth constantly searches devices strategy.
What I have done till now is running an inquiry each time I want.... but I would like to have this process to be continuously, it means that this inquiry runs without any input (like pushing a Command)
I have tried to do that, It works in the emulator but not in my phone....
so please could you advice me some way to do it?
thanks
antonio
Re: Bluetooth: constantly searches devices
Hi i think you can put the inquiry in a while(true) loop
this will make the device always search for devices
thanks.
Re: Bluetooth: constantly searches devices
At midlet startup, start a new inquiry. When this one is finished, you will get your inquiryCompleted() method called. Within its body, just start another one. It will go on forever.
Remember, though, that keeping it this way is very power-intensive and will drain your device's battery pretty quickly.
Daniel
Re: Bluetooth: constant searches devices
I have done it in this way.... but it works only one time! I mean: I do the first inquiry, and then when it goes inside in inquiryCompleted() method, it starts a new inquiry and then it stops.
And I noticed that when a device is doing an inquiry, it cannot be found by others devices which at the same moment are looking for bluetooth devices... is it right? If it is like that there is no sense to have a constant search of devices because this device will be not found by others...
please could you tell me why I do this search only one time and if there is a way that the device could be found even if it is doing a inquiry?
antonio
Re: Bluetooth: constantly searches devices
I had a similar problem, and this happened because I had a call to "cancelInquiry()" method in "inquiryCompleted()" method. Perhaps this is your problem.
Regards
Felipe