Cannot find where the issue is, Bluetooth service discovery

Hi there,
I am developing a client/server bluetooth messaging application and seem to have to run into a brick wall. I am able to perform a device discovery, and the client is able to locate the server, however I am not able to locate the service on the server even though the server and the client are both using the same UUID and service name.
It gets to the point where it displays the status message, "Service search initiated" and then it seems like nothing else happens. I have been staring at the code for days and tried all sorts of tinkering, but have been unable to get it to work.
The UUID and service name I am using is:
48dd1cf559bb41009d0686f7862d26a2
serverand below is the code for my class that I implement the device and services discovery in:
import javax.microedition.io.*;
import java.util.*;
import java.io.*;
import javax.bluetooth.*;
public class SearchForServices implements DiscoveryListener
    private MessageClient client;
    private String StrUUID; //UUID of service
    private String nameOfService; // Name of service
    private LocalDevice local; //local device
    //Discovery Agent
    private DiscoveryAgent discover;
    //store list of found devices
    private Vector devicesFound;
    //table of matching services/ device name & service Record
    private Hashtable servicesFound;
    private boolean searchComplete;
    private boolean terminateSearch;
    public SearchForServices(MessageClient client, String uuid, String nameOfService)
        //create the discovery listener and then perform device and services search
        this.client = client;
        this.StrUUID = uuid;
        this.nameOfService = nameOfService;
         //create service search data structure
        this.servicesFound = new Hashtable();
        try
            //get discovery agent
            local = LocalDevice.getLocalDevice();
            discover = local.getDiscoveryAgent();
            //create storage for device search
            devicesFound = new Vector();
            //begin search: first devices, then services
            this.client.modifyStatus("Searching for devices...");
            discover.startInquiry(DiscoveryAgent.GIAC, this);
        catch(Exception e)
            this.client.reportError("Unable to perform search");
    /////////////Methods related to the device search called automatically///
    public void deviceDiscovered(RemoteDevice remote, DeviceClass rank)
        // a matching device is found.Only store if it's a PC or phone
        int highRankDevice = rank.getMajorDeviceClass();
        int lowRankDevice = rank.getMinorDeviceClass();
        //restrict devices
        if((highRankDevice == 0x0100) || (highRankDevice == 0x0200))
            devicesFound.addElement(remote);
            this.client.modifyStatus("Device Found");
        else
            this.client.reportError("Matching device not found");
    private String deviceName(RemoteDevice remote)
        String name = null;
        try
            name = remote.getFriendlyName(false);           
        catch(IOException e)
            this.client.modifyStatus("Unable to get Friendly name");
        return name;
    public void inquiryCompleted(int inquiryMode)
        showInquiryStatus(inquiryMode);
        //update status
        this.client.modifyStatus("Number of devices found: " + devicesFound.size());
        // start searching for services
        this.client.modifyStatus("Service search initiated");
        findServices(devicesFound, this.StrUUID);
    private void showInquiryStatus(int inquiryMode)
        if(inquiryMode == INQUIRY_COMPLETED)
            this.client.modifyStatus("Device Search Completed");
        else if(inquiryMode == INQUIRY_TERMINATED)
            this.client.modifyStatus("Device Search Terminated");
        else if(inquiryMode == INQUIRY_ERROR)
            this.client.modifyStatus("Error searching for devices");
    //service search////
    private void findServices(Vector devFound, String strUuid)
        //Perform search for services that have a matching UUID
        //and also check service name
        UUID[] uuids = new UUID[1]; //holds UUIDs for searching       
        //add the one for the service in question
        uuids[0] = new UUID(strUuid, false);
        //to include search for service name attribute
        int[] attributes = new int[1];
        attributes[0] = 0x100;      
        //carry out service search for each device
        //terminate search
        this.terminateSearch = false;
        RemoteDevice xremote;
        for(int i=0; i < devFound.size(); i++)
            xremote = (RemoteDevice)devFound.elementAt(i);
            findService(xremote, attributes, uuids);
            if(terminateSearch)
                break;
        //report status
        if(servicesFound.size() > 0)
            this.client.displayServices(servicesFound);
        else
            this.client.reportError("No Matching services found");
    private void findService(RemoteDevice remote, int[] attributes, UUID[] uuid)
        try
            int transaction = this.discover.searchServices(attributes, uuid, remote, this);      
            searchFinished(transaction);
        catch(BluetoothStateException e)
    private void searchFinished(int transaction)
        this.searchComplete = false;
        while(!searchComplete)
            synchronized(this)
                try
                    this.wait();
                catch(Exception e)
    //below methods called automatically during a search for devices
    public void servicesDiscovered(int transID, ServiceRecord[] records)
        for(int i=0; i < records.length; i++)
            if(records[i] != null)
                //get service records name
                DataElement servNameElem = records.getAttributeValue(0x0100);
String sName = (String)servNameElem.getValue();
//terminate search
this.terminateSearch = true;
if(sName.equals(this.nameOfService)) //check name
RemoteDevice rem = records[i].getHostDevice();
servicesFound.put(deviceName(rem), records[i]); //add to hashtable
public void serviceSearchCompleted(int transID, int respCode)
//wake up the waiting thread for this search, enabling the next services
//search to commence
this.searchComplete = true;
synchronized(this)
this.notifyAll();
After doing abit of troubleshooting, I realised that somehow the client is not able to locate the service on the Server, but I do not understand why that should be so, because the UUID and service name are matching on both the client and the server. It just beats me, and I would appreciate it if a 2nd pair of eyes could have a look at the code. Maybe there is something that I am missing.
Thanks, I do appreciate..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Hi there,
I tried a few things such as
1) Changing the UUID for my application, but that didn't make the system work.
2) I then went on to modify the implementation and use the selectService() method of the bluetooth class, but still without any luck.
The only way it works, is if I get the server side to display the connection parameters and I manually enter them into the client side to connect. I do not understand why it is not working the automatic way. I have scanned through my code and logic multiple times, and still cannot figure out what the issue is. :(
Any help would be appreciated...

Similar Messages

  • I have final cut pro x-i have been using the share button previously and had no problem.as of today i share a movie to 720hd, and after a white it says share successful but i cannot find where the movie has been saved???need help

    i have final cut pro x-i have been using the share button previously and had no problem.as of today i share a movie to 720hd, and after a while it says share successful but i cannot find where the movie has been saved???need help--i cannot find the destination. can this be changed.it used to go to itunes, home video.thanks, dimitrios

    EExactly what settings are you using. Some go to iTunes.

  • I photo pics are in album, but need to upload from add item page on etsy.  Cannot find where the pics are in my computer.  I did put a name on each one.  What is the best way to save an individual pic to be able to find it on the computer so as to upload?

    I have an online etsy shop.  There is a page on which to list a new item to be added to one's shop.  When it is time to upload the pic or pics, I cannot find them,eventhough each has a name and all are in an i photo album.  On my old computer I would "save as" and then could find it easily in my computer.  In the new mac I just got, I cannot easily find the pic when trying to upload.  Could you tell me an easy way to save each pic so that I can find it for uploads to that site?  Thanks in advance. OS is Snow Leopard. Whatever i photo came with that would be the product I am using.

    The following is from a post by Terence Devlin on accessing photos for use outside of iPhoto.  It's the definitive treatise on the subject.
    There are many, many ways to access your files in iPhoto:
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    (Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)
    You can access the Library from the New Message Window in Mail:
    There's a similar option in Outlook and many, many other apps.
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    If you want to access the files with iPhoto not running: 
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation   which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and 10.5
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. Drag and Drop: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. File -> Export: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3.Show File:
    a. On iPhoto 09 and earlier:  Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected. 
    b. On iPhoto 11 and later: Select one of the affected photos in the iPhoto Window and go File -> Reveal in Finder -> Original. A Finder window will pop open with the file already selected. 

  • I bought a pre ordered album but cannot find where the available download is at.

    Where do I find where available downloads are in iTunes?

    Hi GoNole5!
    I have an article for you that will help you answer this question:
    iTunes Store: About pre-orders
    http://support.apple.com/kb/ht5714
    Download a pre-ordered item
    When a pre-ordered item becomes available, you will receive an email letting you know that you can download your pre-order.
    If you enabled the option to automatically download prepurchased content in iTunes, then your pre-ordered content may already be in your library. If not, click the download link provided in your email notification, and your pre-ordered content will begin to download. You can also use the Check for Available Downloads feature in iTunes on your computer (choose Store > Check for Available Downloads) to begin downloading your pre-order.
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • I am trying to download an imovie I created to my itunes, but when I log on to Itunes, I cannot find where the movie is.

    How do I find my projects that I download to itunes from imovie?

    With Mac OS X (10.4.7) as in your signature you will not be able to use iCloud, so use the Finder to transfer your movie:
    If you have turned on File-Sharing in the System Preferences "Sharing" tab, you can drag the video to your "Public" folder on your Laptop and retrieve it from there on your desktop computer, assuming this is also a mac.
    You can connect your MBP using usb or Firewire to your desktop computer and boot the the MB in target disk mode (Hold down the "T" key while restarting your MBP). Then your desktop computer will see your MBP as an external disk and you can copy the movie directly.
    Regards
    Léonie

  • I have a VIXIA HF R400 and I love it but I cannot find where the wireless controls are?

    Were are the wireless controls on the VIXIA HF R400? The manua says what they do but not clear instructions on how to access it.

    Hi bgutzman!
    Using the CameraAccess app for iOS devices and Android smartphones, you can control the camcorder from a distance while you view the camcorder's image on the smartphone's screen.  Not only can you control the camcorder to start and stop recording, you can also record the camcorder's image directly onto your smartphone.  The CameraAccess app can be downloaded from either the Apple App Store or the Google Play Store.  When this has been done:
    1)  Set the camcorder to receive remote control commands in the menu.
    2)  Activate WiFi on the settings screen.
    3)  Touch the access point with the same SSID as the one you saw earlier when you set the camcorder for remote control.
    4)  Enter the password.
    5)  Start the CameraAccess app.
    If this is a time sensitive-matter, additional support options are available at Contact Us.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • I want to sync my 2nd generation ipod touch a new laptop with the updated version of itunes but i do not want to lose all of my songs on the ipod. i have backed it up but cannot find where all of the backed up data goes. can you tell me where to find it?

    i would like to sync my second generation ipod touch to a new laptop with the recently updated version of itunes. in order to do this, it deletes all the music of the ipod. i would like to be able to save my music as i have spent alot of money purchases it. i have backed up the ipod in order not to loose any of the music but i cannot find where the songs are backed up to? can you please help me find where the songs have been backed up to so i can save them please

    See:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities
    The iPod backup that iTunes makes does not include synced media like apps and music.

  • I bought osx lion for download but I cannot find where it is on the app store.  i currently have 10.5.8 so I dont know if that has something to do with it.

    i bought osx lion for download but I cannot find where it is on the app store.  i currently have 10.5.8 so I dont know if that has something to do with it.

    You cannot use Lion until you have upgraded to 10.6.8:
    Upgrading to Snow Leopard
    You can purchase Snow Leopard through the Apple Store: Mac OS X 10.6 Snow Leopard - Apple Store (U.S.). The price is $19.99 plus tax. You will be sent physical media by mail after placing your order.
    After you install Snow Leopard you will have to download and install the Mac OS X 10.6.8 Update Combo v1.1 to update Snow Leopard to 10.6.8 and give you access to the App Store. Access to the App Store enables you to download Mountain Lion if your computer meets the requirements.
         Snow Leopard General Requirements
           1. Mac computer with an Intel processor
           2. 1GB of memory
           3. 5GB of available disk space
           4. DVD drive for installation
           5. Some features require a compatible Internet service provider;
               fees may apply.
           6. Some features require Apple’s iCloud services; fees and
               terms apply.
    You received a coupon you can use and redeem on the App Store to download Lion. There is no App Store in Leopard.

  • I have a dvd in my macbook and cannot eject it. the issue is it wont detect it. i cant find the dvd in finder. what do i do?

    i have a dvd in my macbook and cannot eject it. the issue is it wont detect it. i cant find the dvd in finder. what do i do?

    Dear Mary,
    Good Day...
    Restart the macBook holding down the mouse button of your trackpad.......
    Good Luck....
    Regards
    IK

  • I blew my motherboard on an old computer and hooked my old hard drive to the new computer and want to transfer my bookmarks to the new drive but cannot find where they are located on the old drive--any help?

    My motherboard went bad on my old computer, but the hard drive was OK. I purchased a new computer and hooked my old hard drive to it through a usb adapter. I would like to import or copy my bookmarks from the old hard drive to my new one, but I cannot find where they are. I was unable to determine this from searching articles on the web. Be advised that my old hard drive is basically nothing but a storage place for files at this point. My old operating system was windows XP, and my new system is Windows Home Premium.

    https://support.mozilla.com/en-US/kb/Recovering+important+data+from+an+old+profile
    Your old Profile is located here in Win XP and W2K: <br />
    ''drive'':\Documents and Settings\''Windows login user name''\Application Data\Mozilla\Firefox\Profiles\''profile_name''

  • My hard disk crashed and I cannot find out how to "contact customer service" other than this forum.  The website seems to just take me in a circle. I need to de-activate a license but cannot access the software due to a crashed hard drive.  Please help.

    My hard disk crashed and I cannot find out how to "contact customer service" other than this forum.  The website seems to just take me in a circle. I need to de-activate a license but cannot access the software due to a crashed hard drive.  Please help.

    Hi Anthony ,
    Here is the link to connect with Adobe Chat Support.
    https://helpx.adobe.com/adobe-connect/kb/connect-chat-support.html
    Hope your query gets resolved .
    Regards
    Sukrit Dhingra

  • Cannot find where to accept cookies in the security tab in preferences

    I cannot find where to accept cookies in the security tab in preferences.  Can someone guide me?

    If you're using safari - click on Safari -Preferences - then to privacy - and select whether to accept or deny cookies

  • I just downloaded the 30 day trial, However, I cannot find where to open it. How do I do it?

    I just downloaded the 30 days trial. However, I cannot find where to open it. How do I open the application. Thanks

    Like any other application - from your start menu/ launchpad or the applications folder.
    Mylenium

  • I have uninstalled Lightroom and need to re-install it on the same computer. I cannot find where to re-install it. The CC popup window says that it is installed and Up to date.

    I have uninstalled Lightroom and need to re-install it on the same computer. I cannot find where to re-install it. The CC popup window says that it is installed and Up to date.

    CC desktop lists applications as "Up to Date" when not installed
    http://helpx.adobe.com/creative-cloud/kb/aam-lists-removed-apps-date.html

  • HT1657 I cannot play my rented movie because itunes cannot locate where the original file, has anyone face this problem before? Where can I find the location of the downloaded movie?

    I cannot play my rented movie because itunes cannot locate where the original file, has anyone face this problem before? Where can I find the location of the downloaded movie?

    What did you use to download it with? iPad? iPhone? Computer?
    If it's an iPad/iPhone, play it using the videos app.
    If on the computer, look on the left side of iTunes in the library under movies.

Maybe you are looking for

  • Bit Locker on windows 2008 R2 Virtual machine

    Hello there ! We have a a number of Windows 2008 R2 machines and we wish to provide an encryption mechanism for each Virtual machine. It's a VMware environment and all the VM files go into NFS drives. Do you think , Bitlocker will help ? Is Bitlocker

  • G/L Error MIGO Posting

    Hi Experts,            In T code oby6 I have activated purchase account procesing and assigned G/L account in T code OBYC to EIN one P & L account. While posting MIGO I am getting a error that Field Text is a required field for G/L account 1000 49820

  • Nokia 5200 - Videos from PC to Phone... help!

    I want to get some videos from my PC to my phone's card, and be able to play them. I tried just dragging the videos I wanted straight to the file, but that did not work when I tried to play them back. =( As for the Nokia PC Suite, when I asked it to

  • Problem in ACS 5.2 on Virtual Machine

    Hi Everyone ! I have a problem with the interface on the ACS 5.2 , The inferface work fine but going down unexpectedly and only if I make (for example) a ping to the default gateway it come back.   Please somebody can help me ?? Regards. Rodrigo

  • Change from case-sensitive disk format to the normal Mac OS Extended.

    Hi, I need to change from a case-sensitive disk format to the normal Mac OS Extended Journaled version. I have no external HD fitted, but I do have some DVD-Rs. I need to restore the data from 2 users, including iTunes and iPhoto files. What's the be