BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-25-2009, 06:19 AM   #1
jobincantony
Knows Where the Search Button Is
 
Join Date: Jun 2008
Model: 9000
PIN: N/A
Carrier: Vodafone
Posts: 17
Question Bluetooth radio ON/OFF status

Please Login to Remove!

Hi,

Is there any API for checking the Bluetooth radio ON/OFF status? or any API for enable the bluetooth?

I am developing a bluetooth application with auto start on device startup feature. My application will try to open connection with the first paired BT device @ start-up. But the BT open activity was failed due to Bluetooth radio is OFF at the start-up.

But , if i use the API javax.bluetooth.DiscoveryAgent.startInquiry(), the device is asking to enable the bluetooth. So there may be an API retrieving the bluetooth status.

Please Help.

Jobin
Offline  
Old 02-25-2009, 09:29 AM   #2
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

You can get the BT radio status, but the best you can do is to get the system to ask the user to enable BT as you have seen. There doesn't seem to be any way to turn the BT radio on without user action, probably for security.
Offline  
Old 02-25-2009, 10:23 AM   #3
jobincantony
Knows Where the Search Button Is
 
Join Date: Jun 2008
Model: 9000
PIN: N/A
Carrier: Vodafone
Posts: 17
Default

Thank you for your quick reply.
could you please tell me how can we get the status?
Actually the BT radio was turned on before the device going to soft reset/hard reset. So the device will turn on the BT radio automatically after the reset. but my application is trying to open the BT connection before the BT radio was turned on by the starting process.
Offline  
Old 02-25-2009, 05:56 PM   #4
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

Ah ok see your need. I'm away from my code base and can't remember if I use an API call, or a connection failure to find out if the radio is off but have a look at:
javax.bluetooth.LocalDevice.isPowerOn()

The documentation is kind of thin, but the name is promising.
Offline  
Old 02-26-2009, 03:48 AM   #5
jobincantony
Knows Where the Search Button Is
 
Join Date: Jun 2008
Model: 9000
PIN: N/A
Carrier: Vodafone
Posts: 17
Default

Thank you... i can get the status with javax.bluetooth.LocalDevice.isPowerOn().

But How can we instruct the blackberry device to Turn ON the bluetooth radio?

Currently i found that, if the BT radio is turned off and user make a call on javax.bluetooth.DiscoveryAgen.StartInquiry(), the Blackberry will POP -up a message " The Application name requires bluetooth to be enabled. Enable Bluetooth? yes | No.


Actually i am searching for a function to do the same. ( i don't want to search the bluetooth devices in range... coz i already have paired devices:smileymad: )

Jobin
Offline  
Old 02-26-2009, 07:34 AM   #6
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

I don't think there is a way for a third party app to turn Bluetooth on. The best you can do is call StartINquiry() and hope the user will agree to turn it on. Bluetooth is a suspect technology in the Blackberry world, there are lots of ways it has been used to attack mobile phones.
Offline  
Old 02-27-2009, 09:12 AM   #7
jobincantony
Knows Where the Search Button Is
 
Join Date: Jun 2008
Model: 9000
PIN: N/A
Carrier: Vodafone
Posts: 17
Default

Ok..

by the way Is there any method to get the Bluetooth radio ON/OFF status in OS V 4.0.2?

I have tried to make an API call

BluetoothSerialPort.getSerialPortInfo()

It will thrown an exception if the BT is turned off and working in some models with OS v up to 4.2.

But it will not thrown an exception even if the BT was turned OFF in BB perl with OS v 4.2.1

Any other useful method?
Offline  
Old 02-27-2009, 10:36 AM   #8
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

You have a 4.0 device? I only go back to 4.1, sorry.
Offline  
Old 02-27-2009, 01:27 PM   #9
jobincantony
Knows Where the Search Button Is
 
Join Date: Jun 2008
Model: 9000
PIN: N/A
Carrier: Vodafone
Posts: 17
Default

ok. I think javax.bluetooth has been introduced from v4.2.1.
So i need to take care it without this. it would be helpful if u could have a solution for this in 4.1 os.

thank you .
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


1pcs Fanuc Servo Amplifier A06B-6077-H002 New by DHL or EMS picture

1pcs Fanuc Servo Amplifier A06B-6077-H002 New by DHL or EMS

$1089.00



1PC MITSUBISHI SERVO Amplifier MR-J2S-350B NEW In Box Expedited Shipping picture

1PC MITSUBISHI SERVO Amplifier MR-J2S-350B NEW In Box Expedited Shipping

$619.00



Used Fanuc Servo Amplifier A06B-6114-H102 picture

Used Fanuc Servo Amplifier A06B-6114-H102

$915.08



Used Fanuc Servo Amplifier A06B-6114-H101 picture

Used Fanuc Servo Amplifier A06B-6114-H101

$903.09



BJ300 Plus BJ300Plus 3-30MHz Radio Power Amplifier +Fan FM 100W AM 200W SSB 300W picture

BJ300 Plus BJ300Plus 3-30MHz Radio Power Amplifier +Fan FM 100W AM 200W SSB 300W

$104.49



Winbridge S92 PRO - Bluetooth Mini Portable Rechargeable Voice Amplifier Karaoke picture

Winbridge S92 PRO - Bluetooth Mini Portable Rechargeable Voice Amplifier Karaoke

$35.00







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