Chapter 10. Remotely Drive a (toy) Sports CarGrab your Walther PPK, slip it nonchalantly into Q-branch's specially modified Berns-Martin triple-draw holster. The name's Bond, BlackBerry Bond.
Choosing how to integrate a sophisticated mobile device into the hectic lifestyle of a MI5 agent with a "double-0" prefix is surprisingly difficult. Perhaps it could play a dual role as a jet pack, hand glider, or a vodka martini flask?
I finally found inspiration in the movie Tomorrow Never Dies, where Bond remotely drives his BMW 750iL (modified with rockets, tear gas, and tire spikes) via a mobile phone. He unfortunately didn't choose a BlackBerry for this task, which may explain why the car ended up falling off the roof of a hotel car park.
Sadly, the vast finances of Apress don't stretch to them buying me a BMW, but they promised me something similar, comparable with my status within the company. In due course, I received the Dream Cheeky USB Remote Control Mini Car, complete with its own garage (see the picture at the top).
I was somewhat disappointed to note that the car is only 9 cm long, but as the Dream Cheeky website reports: it "performs like a real road car to drive away boredom at home or work."
The black wire coming out the back of the garage in the picture at the top of the page is a USB cable that plugs into a PC. Inside the garage is an infrared transmitter which lets the car race around several meters from the garage.
My plan for connecting the 'system' to my BlackBerry is summarized by the diagram on the right
The idea is to use the BlackBerry's Bluetooth support to communicate with a PC (the 'BaseStation') which converts the Bluetooth messages into USB commands sent down the cable to the garage. This configuration offers the user the chance to walk along with his car as it travels around the office, controlling it with the Blackberry, via the PC.
This approach also offers a few advantages for the developer. One is that the implementation can be split into smaller parts. The GUI interface and client code on the BlackBerry (the CarController in the diagram) can be developed independently of the BaseStation, which consists of a Bluetooth server and USB command generator. These two components can also be implemented separately, leading to an application constructed from three fairly distinct pieces:
The rest of this chapter describes the application by focusing on each of these parts in turn.
Dr. Carol Hamer
E-mail: carol.hamer@gmail.com
To Carol's blog
Dr. Andrew Davison
E-mail: ad@fivedots.coe.psu.ac.th
To Andrew's home page