×

Discussion Board

Results 1 to 6 of 6

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    88

    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

  2. #2
    Registered User
    Join Date
    Apr 2007
    Posts
    18

    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.

  3. #3
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    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

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    88

    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

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    From my experience: You have to start an inquiry from a separate thread. Each new inquiry has to start from a new thread (from inquiryCompleted).

    Furthermore, I discurage you from doing this, too. Bluetooth was not designed with this in mind! Reconsider your server/client/master/slave setup instead. For example, in your situation do an inquiry and when your service is not found around register a service record, and wait for another device to connect for example via the Push Registry…

  6. #6
    Registered User
    Join Date
    Mar 2007
    Posts
    23

    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

Similar Threads

  1. How To Make The S60 Emulator See My USB Bluetooth Dongle ?
    By Mo7ammed_01 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-07-25, 00:12
  2. unable to find bluetooth devices using j2me
    By vitalmd in forum Bluetooth Technology
    Replies: 0
    Last Post: 2006-02-16, 10:09
  3. Bluetooth devices in a listbox
    By vinsofts in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2005-06-20, 13:27
  4. How to find more bluetooth devices than one in discovery?
    By wudilp in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-03-25, 15:23
  5. Can I use Bluetooth in my application in Nokia devices?
    By Nokia_FAQ in forum PersonalJava
    Replies: 1
    Last Post: 2002-05-13, 19:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×