Everything Motorola Q  
Home Motorola Q Store Moto Q Software News Motorola Q Reviews Moto Q Forums Q Social Moto Q FAQ Contact Us Everything Q RSS feed


Go Back   Motorola Q Forum | Everything Q > Q Software Developers > Software Developers

Notices



Reply
 
Thread Tools Display Modes
Old 09-18-2007, 12:36 PM   #1 (permalink)
 
Join Date: Sep 2007
Posts: 12
Thanks: 3
Thanked 25 Times in 1 Post
machx0r is on a distinguished road
Question Bluetooth Toggle

By nature I'm lazy, I'll spend hours writing applications so I can shave mere seconds off repetitive tasks. To that end I'm looking to write an application that when launched will toggle the bluetooth state. I've looked at the Broadcom/Widcomm SDK but they don't seem to expose any methods to disable/enable the radio.

I've determined that the "StackMode" registry key at HKEY_LOCAL_MACHINE\Software\Widcomm\BtConfig\Gener al controls the bluetooth state when the stack is loaded (0 = off, 1 = on, 2 = discoverable? [not sure about 2]).

It appears as though BTTray.exe loads the BT stack.

At first it looked like it'd be as simple as:

1. Kill BTTray.exe
2. StackMode = StackMode == 0 ? 1 : 0
3. Launch BTTray.exe

This seems to work fine if the device booted with Bluetooth turned off and it has never been started. However once the stack has been loaded once this process results in an error message: "There was an error loading the Bluetooth Stack (0x1).", everytime BTTray.exe is loaded and BT stops working until the device is reset.

Seems like something else is holding onto, and keeping open, the BT stack but I'm not sure what. Any suggestions are greatly appreciated.
__________________
-- Cory

www.charltonfamily.net
machx0r is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 09-18-2007, 12:49 PM   #2 (permalink)
Super Moderator
 
rudeboy's Avatar
 
Join Date: Jan 2007
Location: Skaville, Skamerica
Posts: 27,089
Thanks: 273
Thanked 1,929 Times in 1,590 Posts
rudeboy is on a distinguished road
Send a message via ICQ to rudeboy Send a message via MSN to rudeboy Send a message via Yahoo to rudeboy
Default

how about this ?
__________________
later..
rb.


rudeboy is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to rudeboy For This Useful Post:
machx0r (09-18-2007)
Old 09-18-2007, 01:14 PM   #3 (permalink)
 
Join Date: Sep 2007
Posts: 12
Thanks: 3
Thanked 25 Times in 1 Post
machx0r is on a distinguished road
Favorite

I knew that search function was good for something ;)

That's a nice little hack that certainly accomplishes what I'm looking for. Would still like to find a solution that allows me to toggle programatically rather than by emulating keypresses so I can monitor for and recover from any failure conditions.

On a related note does anyone know how to copy files that are located on the ROM. Maybe if I could look at BTTray.exe or wrlsmgr.exe it would help.
__________________
-- Cory

www.charltonfamily.net
machx0r is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT -5. The time now is 12:50 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Integrated by BBPixel ©2003-2008, jvbPlugin
Android forums

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33