I wrote a program to turn Bluetooth on and off

Discussion in 'Motorola Q' started by larsdennert, May 28, 2007.

  1. larsdennert

    larsdennert Active Member

    Joined:
    Aug 9, 2006
    Messages:
    2,849
    Likes Received:
    0
    I wrote a program to turn Bluetooth on and off

    I recently ordered some BT sunglasses but I also use a Moto HS850 and hate going through the menus to turn BT on and off.

    I wrote a little app that does it for me.

    First, install Mortscript. You can hunt for the full installer or just use the cab here: http://67.122.16.97/lars/misc/smartphone/MotoQ/MortScript-4.0-SP.cab


    Then copy my script http://67.122.16.97/lars/misc/smartphone/MotoQ/BTcycle.mscr to anywhere on your phone. Create a shortcut for it on your start menu and then a speed dial to that.

    Every time you run the speed dial the BT should cycle. Enjoy!
  2. fusion1

    fusion1 Member

    Joined:
    May 27, 2007
    Messages:
    671
    Likes Received:
    0
    Sorry for the newbie question but how do you create a shortcut on the Q? Is this with the registry editor? That's the one thing I haven't tried yet and mainly I don't want any hacks to render my new phone unusable if I make a wrong edit.
  3. larsdennert

    larsdennert Active Member

    Joined:
    Aug 9, 2006
    Messages:
    2,849
    Likes Received:
    0
    Open the file explorer on the Q and navigate to the BTcycle file, click menu-file-Createshortcut, navigate to \windows\startmenu and click done. Now open the start menu and find the shortcut you just created, select menu-addspeeddial. Use a one digit speed dial number for best results.

    I didn't put much time into this. I wrote it with one hand while holding my sleeping newborn in the other. I should tweak it at some point.
  4. fusion1

    fusion1 Member

    Joined:
    May 27, 2007
    Messages:
    671
    Likes Received:
    0
    haha sweet I will try it. Thanks. Glad you had something to occupy your time while with the newborn.
  5. fusion1

    fusion1 Member

    Joined:
    May 27, 2007
    Messages:
    671
    Likes Received:
    0
    Yes this works perfectly. How does one start programming using something like mortscript? Is the programming done on a PC in notepad or something?
  6. larsdennert

    larsdennert Active Member

    Joined:
    Aug 9, 2006
    Messages:
    2,849
    Likes Received:
    0
    It's a Visual Basic interpreter. If you've written vbs vb or any programming at all you'll feel right at home. I use vbs at work all the time for quick hacks on the pc. This will open up all sorts of applications on the Q to create almost any app or automation I need. I don't have the time to use Visual Studio to create full on compiled apps but small utils I can squeeze time in for.

    As with any app, always be careful of it's source. I cringe to think what will happen when the script kiddies start their nasty tricks like with emailing vbs viruses.
  7. larsdennert

    larsdennert Active Member

    Joined:
    Aug 9, 2006
    Messages:
    2,849
    Likes Received:
    0
    I improved the code so it runs faster now. New version at same location on second link of first post. Just overwrite the old file with the new.
  8. jareti

    jareti New Member

    Joined:
    May 31, 2007
    Messages:
    20
    Likes Received:
    0
    I configured mine to use the Windows Basic home screen and it provides a one button access to the Wireless Manager which has BT on\off and Broadband networking on\off, although it's not obvious that what it is. It's the first selection on the home screen. So after unlocking the phone hit the center nav button to access the Wireless Manager.
  9. larsdennert

    larsdennert Active Member

    Joined:
    Aug 9, 2006
    Messages:
    2,849
    Likes Received:
    0
    Yes there are several ways to turn the BT on and off but all still take 3-4 clicks minimum and watching the screen. If you aren't messing with BT very often a few clicks is no problem and not worth doing this hack. Everyone uses their Q differently though. Being able to optimize it for you is what's important.

    You can also hold the Home button down from anywhere to access that menu.
  10. fusion1

    fusion1 Member

    Joined:
    May 27, 2007
    Messages:
    671
    Likes Received:
    0
    I was trying to figure out why my H700 bluetooth headset wasn't connecting. It coincided right after I installed the BT hack. Like it would work the first time to turn BT on. ANd it would also work to turn it off. But then there lies the problem. It won't turn it back on again. It will keep searching and searching. Only way to find it, at this point is to remove the headset from the list and start it from scratch. If this is a known issue and the new version addresses it, I might download it. Otherwise I guess I will go back to using 4 clicks.
  11. larsdennert

    larsdennert Active Member

    Joined:
    Aug 9, 2006
    Messages:
    2,849
    Likes Received:
    0
    Are you saying BT doesn't turn again or the two devices won't pair? The program doesn't do anything that you can't do with keystrokes. If the BT on the phone isn't behaving, I would power cycle the phone. I had this happen once too but don't recall which version. I haven't been able to reproduce it. The new version is more efficient and maybe the phone was getting confused. Also headsets don't like having BT disconnected on them and sometimes want a power cycle to re-pair. Having a shortcut can have you turning off BT more than you did before.
  12. fusion1

    fusion1 Member

    Joined:
    May 27, 2007
    Messages:
    671
    Likes Received:
    0
    Actually it will never pair after the BT is turned off (with the BT script). I can turn BT on/off through the manager manually and the headset never has a problem pairing with the Q. If I use the 1 button speed dial it will turn on BT; turn off BT but then it sometimes doesn't even respond to the speed dial # trying to turn it on, but if it does it will not connect.
  13. fusion1

    fusion1 Member

    Joined:
    May 27, 2007
    Messages:
    671
    Likes Received:
    0
    Ideally I would only use BT when listening to streaming audio. So for the most part I would like BT set to off. I just don't like 5 minutes of pairing a device when I choose to use BT. Maybe I'm not as patient as some of you out there.
  14. JBlacker

    JBlacker New Member

    Joined:
    Jun 30, 2007
    Messages:
    14
    Likes Received:
    0
    I tried doing as you say, and it don't work for me. The only way I can paste it on my Q is to save it to a word pad or note pad and put it on my Q. Is there another way to do this.

    THanks
  15. larsdennert

    larsdennert Active Member

    Joined:
    Aug 9, 2006
    Messages:
    2,849
    Likes Received:
    0
    Sounds like you're having trouble copying files to your Q. Connect the phone with active sync then click explore in activesync. That will bring up the phone's file system. Now you can copy files from a pc's explorer window and paste to the Q.
  16. JBlacker

    JBlacker New Member

    Joined:
    Jun 30, 2007
    Messages:
    14
    Likes Received:
    0
    That is what I am trying, and it won't let me paste the text. If I paste in a word or note pad, it won't work. I tried coping the text from the web page, but it will not let me paste in to the phone.

    Thanks for your help.
  17. larsdennert

    larsdennert Active Member

    Joined:
    Aug 9, 2006
    Messages:
    2,849
    Likes Received:
    0
    From the web page you need to save the file to your computer, not open it. You need to be copying files not the text within. Not only that, you need to install mortscript by copying the cab file to the phone and installing it.

    There is plenty of info in other threads on how to do these Q basics. You may want to search a bit on this and how to create shortcuts and other functions.
  18. fusion1

    fusion1 Member

    Joined:
    May 27, 2007
    Messages:
    671
    Likes Received:
    0
    Lars my BT Cycle stopped working somehow, not sure why but the speed dial still showed up but it would never activate it. I downloaded the BT script again and now it's like 3 times as fast. You weren't kidding how fast it is compared to the old version works like a charm now. Thanks!
  19. larsdennert

    larsdennert Active Member

    Joined:
    Aug 9, 2006
    Messages:
    2,849
    Likes Received:
    0
    Cool. Glad it works for you. The early version did have some issues.
  20. mswlogo

    mswlogo New Member

    Joined:
    Jul 30, 2007
    Messages:
    48
    Likes Received:
    0
    I just had a thought.

    I believe the Bluetooth in this unit is dumb (or perhaps dumb with some headsets).

    It has 3 states of connectivity with a headset. These are names I made up not technical/officual names.

    1) Sleep
    2) Connected
    3) Active

    In Sleep mode it uses very little battery.
    In connected or active state (they are actually so close in state they are nearly the same and use the same amount of battery).

    You start in sleep, you make/receive a call and you are in connected state. You STAY in connected state after the call until you disconnect headset manually. Or headset goes out of range.

    So if you could toggle bluetooth periodically in the background, you would also disconnect the headset (I think). Now if you could detect if the phone is in a call you skip toggling bluetooth.

    So in essence it becomes an Auto disconnect headset daemon. My wife can go 3 days on a charge no problem with Bluetooth ON in the sleep state. She can't go a day if it's in the connected state for more than a few hours. It's the connected state that kills the battery NOT bluetooth being on itself.

Share This Page