Mike Taulty's Blog
Bits and Bytes from Microsoft UK
Updated Bluetooth Remote Control for SmartPhone

Blogs

Mike Taulty's Blog

Elsewhere

I've published the updated version of the "PowerPoint" remote control that I wrote for SmartPhone.

Morgan contributed a whole bunch of code to this - in particular, what he's done is to make the actions performed by the desktop listener in response to receiving key presses from the SmartPhone completely configurable.

So, the SmartPhone sends keypresses over Bluetooth to the desktop listening app. That app then has a configuration file which allows you to specify a number of Routers which perform actions based upon the key presses received.

The default one sends the keys on to PowerPoint in SlideShow mode using OLE automation (as described in the previous post).

Morgan has a second router in there (commented out by default) named the "ActiveApplicationRouter". This uses functionality from a library (TInputHlp.dll) that I think he got from an old John Robbins article and it uses the SendKeys format for the commands that the ActiveApplicationRouter will send to the active application on receipt of control keys from the SmartPhone.

This means that you can easily do away with the default Router that I wrote (and which is still plugged in by default) and replace it with the ActiveApplicationRouter because you can make that drive any app - I think Morgan's particular idea was to get it to drive Windows Media Center 2005 and I'll have a stab at posting a configuration file which makes Media Center work from the SmartPhone.

I've uploaded a new version of the installer - you need to download this zip file and run through it. Note that you need ActiveSync and various other bits and pieces to get this to work as "detailed" in the previous post.

I've also uploaded the complete source code for this - you can download it from here. Note that this is quite a number of projects and there are some batch files in the build process that would need to be "modified" in order to get it to build for you. I'm happy to take the odd question on this if people have them. The project structure is something like;

BluetoothAddressing: Simple utility classes for playing with Bluetooth addresses.

BluetoothDesktopTrayApp: the desktop listening component which invokes routers in response to SmartPhone command keys.

BluetoothSmartphoneApp: the smartphone application that connects over Bluetooth to the desktop bits.

PptUtilities: Office interop code that drives PowerPoint.

Routers: The definition of the routing interface and the implementation of the 2 that we have: ActiveApplicationRouter and PowerPointKeyPressRouter.

XpBluetooth: Code to provide a managed wrapper around working with the sockets API from a Bluetooth perspective.

XpBluetoothHighLevel: Higher level wrapper to make the XpBluetooth assembly easier to work with.

BluetoothRemoteControlSetup: Setup project.

All of this is written in C# with the exception of the XpBluetooth project where I resorted to managed C++ in order to make the calls to the API's easier without having to get into StructLayout and all that stuff in the System.Runtime.InteropServices namespace.

Enjoy! If someone makes this better then feel free to let me know!

 


Posted Tue, Dec 7 2004 3:24 PM by mtaulty

Comments

mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Thu, Feb 24 2005 2:38 PM
Just Awesome. I've amazed a few people with what these phones can do! Thank you for writing this. Now if I can just a little mini-USB laser pointer... (and plug it into my phone's connector)
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Thu, Feb 24 2005 3:51 PM
Glad that you liked it and that you can get it to work - others couldn't :-)
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Mon, Mar 7 2005 3:36 AM
Hi, Im wanting to use a similar approach to what you have used with this project for a bluetooth chat program for a project. Your code is excellent by the way and it works fine on my computer at home! When I got it to uni however I realise that the desktop listener just doesnt want to listen. It just says error listening for connections. Im guessing its the bluetooth widcomm driver thats the difference here? Im using a MSI Bluetooth USB Dongle! Could you point me to where I can get a driver that will work with you program? Thanks.
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Mon, Mar 7 2005 5:11 AM
Hi. I'm getting the impression that this code only works with the standard XP (Sp2) driver that MS installs rather than device specific drivers.

I'm not sure whether you can get the standard XP driver to work with your dongle or not - if not then you'd possibly have to pull the code apart to see if you can communicate through the driver that you have.

Thanks,

Mike.
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Tue, Mar 29 2005 1:35 PM
Very interesting peace of code. Great job!
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Mon, Apr 18 2005 1:08 AM
Any chance of a Pocket PC version?
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Fri, Apr 22 2005 8:01 AM
Y'all should check out the Pebbles project at CMU. They haven't done this for Smartphones (looks cool!) but have for PocketPCs and Palms.
mtaulty wrote Bluetooth Remote Control for Home Appliances
on Thu, Jun 30 2005 11:05 PM
Is it possible to do this project? Please comment and guide through the process that I should go through. Thanks
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Fri, Sep 2 2005 7:11 AM
Any reason the joystick can't be used?
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Thu, Sep 8 2005 5:26 AM
Nope, you should be able to modify the code to make it do that.
mtaulty wrote Does it work with Win2000 Pro?
on Sun, Sep 11 2005 6:59 AM
I'm itching to try this (could really use it at work) but after reading all the notes i'm getting the feeling that you may also have Win XP as another min requirement? is this correct?

i have Win2K (@work), Activesync 4.0, & BT works.
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Tue, Sep 13 2005 3:02 PM
I think it's only going to work on Win XP with the standard MS stack.

Sorry!

Mike.
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Sun, Feb 26 2006 3:54 AM
hi, Mike

i want to know where i can get the BluetoothAPI's.h header file it is giving me error at the time of compilation.
i did searched in my PC but no help,

And how do i enable bluetooth in SmartPhone 2003, Whenever i go to on the Bluetooth it give me error no hardware found but i have USB Bluetooth Dongle installe din my PC

i will br happy to recieve urs contact add or pho
mine email id is whatisid_virus@yahoo.com

Kindly help me PLz
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Tue, Mar 7 2006 10:24 AM
hi mike,
Got ur code finding it very excited, but love to have some documentation about project so that it help me easy to understand.so if u have it can u plz mail it to me ..email id "chinu_prakash@rediffmail.com". and "justbringit_prakash@yahoo.com".
waitn for ur quick reply.
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Mon, Mar 20 2006 1:33 AM
good!!
mtaulty wrote re: Updated Bluetooth Remote Control for SmartPhone
on Tue, Apr 18 2006 4:27 PM
I have a motorola mpx220 and I want to use the phone closed, using de volume up and down keys. I download the source code but I cant change it. Do u know how to do it?