BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-15-2008, 03:11 PM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: idk
Posts: 84
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Bluetooth adapter programming

Please Login to Remove!

Hi everyone!
I'm running some tests on a bluetooth adapter for printers.
It works fine when I print from the PC but I'd like to print with my BlackBerry...

So I created a small application which :
-Retrieves the paired devices
-Retrieves the services available for the device
-Connects to the selected service

I am able to retrieve the devices and the services.
There is only one service available for the adapter :
Bluetooth Serial Port
great!

Now I want to send data to the printer...
Code:
String URL = _service.getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT,false);
            
            StreamConnection connection=null;
            try
            {
                 connection= (StreamConnection) Connector.open(URL);
            }
            catch(IOException io)
            {
            }
            
                try
                {
                    byte[] buffer  = new byte[100];
                    String msg = "hello there";
                    InputStream din = connection.openInputStream();
                    OutputStream dout = connection.openOutputStream();
                    
                    dout.write(msg.getBytes());
                    dout.flush();
                    
                    din.read(buffer);
                    dout.close();
                    din.close();
                    connection.close();
                }
                catch(IOException ie)
                {
                }
        }
I am able to get the URL but nothing happens when I call Connector.open(URL)
It doesn't crash or anything...
it just freezes there.

Any help?
(PS : I know that the printer won't understand "Hello There" ;) It's just a test)
__________________
Stop telling me what it can do...
Show me how to make it do it!!!!
Offline  
Old 07-16-2008, 02:19 PM   #2 (permalink)
MBW
Talking BlackBerry Encyclopedia
 
MBW's Avatar
 
Join Date: May 2008
Model: 8110
PIN: N/A
Carrier: AT&T
Posts: 393
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't know enough about the API to comment directly, but I do know that without a parlay of elements (O/S, service & transport, to oversimplify) all hitting the right versions, the handset doesn't have HTML to rasterize.

I know of only one BT printer at the moment that has a BB driver, and it's limited by this; they're working on it and will have full BB drivers in (wild guess) 6-8 weeks.

I'm a reporter/reviewer - if you're prepping a BT printer for BB, send me a private message and I'd like to arrange to review it.

If your boss's name is Doug, I already have it.
__________________
/\/\\/\/
Offline  
Old 07-19-2008, 07:43 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 134
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does anyone know how to connect a BlackBerry device to all the nearby accesible BlueTooth Handsets and then exchange data ?

Is it possible to have automatic Bluetooth pairing ?
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.