Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
hervens
Posts: 12
Registered: ‎08-06-2011
My Device: curve 8300

Accesing bluetooth devices with blackberry

Hello,

How can you access, or pair with a device, such as a printer or a barcode scanner running a bluetooth HID profile with your blackberry?

So far, I have the following code, but it only seems to detect other discoverable cellphones, and does not detect other bluetooth devices such as a printer, ps3 controller, barcode scanner, etc.

Thanks

 

private void searchDevices() throws BluetoothStateException
    {
    	Dialog.alert("in begining of alert");
    	LocalDevice local = LocalDevice.getLocalDevice();
    	DiscoveryAgent agent = local.getDiscoveryAgent();
    	Dialog.alert("device search about to start");
    	final boolean inquiryStarted = agent.startInquiry(DiscoveryAgent.GIAC,
    	        new DiscoveryListener() 
    				{
    	            public void deviceDiscovered(RemoteDevice device, DeviceClass cod) 
    	            {
    	                Dialog.alert("Discovered device woot! : "
						        + device.getBluetoothAddress());
    	            }

					public void inquiryCompleted(int discType) 
					{
						Dialog.alert("inquiry completed");
					}

					public void serviceSearchCompleted(int transID, int respCode) 
					{
						Dialog.alert("service search completed");
						
					}

					public void servicesDiscovered(int transID, ServiceRecord[] servRecord) 
					{
						Dialog.alert("service discovered");
						
					}

    	            });
    	
    	Dialog.alert("inquiryStarted returned: " + inquiryStarted);
    }

 

Please use plain text.
Contributor
hervens
Posts: 12
Registered: ‎08-06-2011
My Device: curve 8300

Re: Accesing bluetooth devices with blackberry

anyone?
This is really important for me
Please use plain text.