Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

J2se + bluetooth help

  • 06-04-2007 1:25am
    #1
    Registered Users, Registered Users 2 Posts: 221 ✭✭


    Hi all,

    I'm currently working on a project witch involves a client midlet running on a phone to communicate with a server on a pc. For this communication I'm using RFCOMM . Bluetooth on the phone side is fine however when i try to use it on my computer i am unable to obtain the local device .

    I have tried several stacks including bluecove, electric blue and Atinav but all have the same result .

    The following is a sample program i wrote and the output it gives
    import javax.bluetooth.*;
    //import com.intel.bluetooth.*;
    import javax.microedition.io.*;
    import java.io.*;
    import java.lang.*;
    import java.util.*;


    /**
    *
    * @author Sean
    */
    public class Main /*implements DiscoveryListener*/{

    /** Creates a new instance of Main */
    public Main() {
    }

    public static Vector BTD = new Vector();
    public static Vector BTC = new Vector();
    public static LocalDevice local;
    DiscoveryAgent agent;



    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    // TODO code application logic here

    System.out.println("In Find Devices\n");
    try {
    local = LocalDevice.getLocalDevice();
    local.setDiscoverable(DiscoveryAgent.GIAC);

    // agent = device.getDiscoveryAgent(); // obtain reference to singleton

    } catch (BluetoothStateException ex) {
    ex.printStackTrace();
    System.out.println("cant get localdevice");
    }
    System.out.println("Address is : " + local.getBluetoothAddress());
    System.out.println("stuff : " + local.getFriendlyName());



    }

    I'm using netbeans and my ide. running windows xp sp2 and have WIDCOM bluetooth software.

    All help would be brill thanks

    -Elfman


Advertisement