Wireless DevCenter    
 Published on Wireless DevCenter (http://www.oreillynet.com/wireless/)
 See this if you're having trouble printing code examples


Bluetooth on Mac OS X

by Wei-Meng Lee
08/13/2002

Editor's Note: Bluetooth is a low-cost, short-range wireless technology that allows devices to detect and connect to one another. One of the first practical applications of this technology is to provide an easy way for us to connect our cell phones to our computers. Everyone knows how difficult it is to type addresses and phone numbers into our phone address books, let alone input more advanced PIM data. But if the computer could be used to easily organize and transfer this information, then that would enable us to take better advantage of the growing capability built into our phones. In this article, Wei-Meng Lee tests Apple's new Bluetooth software and establishes a connection with his Sony Ericsson T68i phone.

Starting with Mac OS X v.10.2 (a.k.a. Jaguar), Apple will include support for Bluetooth devices. While you may not have the latest Mac OS updates, you can now try out the Bluetooth support using Apple's Bluetooth Software Technology Preview 2.1. Note that this technology preview only works on Mac OS X v.10.1.4, or later; folks running Mac OS 9 should really consider upgrading to Mac OS X to exploit the power of Bluetooth.

Getting the Hardware in Order

My goal was to get my Ericsson T68 mobile phone talking to my Mac. (Technically my T68 is really a T68i as I have recently upgraded its firmware.) The current Apple-supported Bluetooth adapter is the D-Link DWB-120M USB Bluetooth Adapter

D-Link DWB-120M USB Bluetooth adapter Ericsson T68
The D-Link DWB-120M USB Bluetooth adapter is ordained by Apple, but it's difficult to get your hands on, and my Sony Ericsson T68i phone was ready to communicate with my Mac.

I tried ordering the adapter from my local AppleStore and Apple distributors, but was dismayed to learn that the stocks will only come in a couple of weeks later, pending certification and testing by the local telecommunications authority. However, I am not satisfied waiting for the adapter to arrive. And I recalled buying a PC USB Bluetooth adapter from 3Com some time back but was too busy to really try it out.

The 3COM Wireless Bluetooth USB Adapter

But hey, can it work on the Mac? I was skeptical at first and then my worries got confirmed the moment I plugged it into my eMac's USB port (I had by then already downloaded and installed the Technology Preview 2.1). I used the Bluetooth item on my Network Preference Pane (more on that later on) and my eMac just could not detect the newly inserted USB Bluetooth adapter. Some messing with the USB ports later I noticed something interesting. When I plug it into my eMac's keyboard, it gave me a "USB Low Power Notice" message.

The message displayed when the adapter was plugged in

And that really got me interested! That confirms that my eMac is detecting the device but due to some reasons it is not able to use it. My suspicion (due to the message) was that my adapter needed some power (the strange thing is that on the PC it works fine and the blue light came on when it is plugged in). And so I ran to the nearest PC shop and got myself a new powered USB hub, plugged in the power to the hub and the USB Bluetooth adapter to hub. I was convinced it would work, since the D-Link adapter was also built according to the Bluetooth 1.1 specifications.

The USB Bluetooth adapter with the USB Hub

To my delight, the adapter works! And what's even better is that the adapter still works when the power to the USB hub is removed. Now, don't ask me why it works; I am not an electrical/electronic person. You go figure! One thing though, the blue light on the adapter does not light up.

Configuration Panel

Now that the adapter is firmly plugged in into my eMac, I need to be able to use it to find other devices. If you've installed the Apple Bluetooth Software Technology Preview 2.1, you would have the Bluetooth item in your System Preferences:

The Bluetooth configuration item in System Preferences

Clicking on the Bluetooth item will reveal a configuration window containing four tabs:

The Preference Pane allows you to control whether your computer is discoverable, whether you require authentication and/or encryption, etc.

Pairing

For now, I just want to connect my T68i mobile phone to my eMac. So, the first thing I do is to turn on the Bluetooth on my T68i and make it discoverable. Next, on my eMac, I clicked on the Paired Devices tab and click on the New... button:
Pairing two devices

Upon discovering the T68i, I clicked the Pair button to perform the pairing of the my computer and the T68i. You would need to supply a Passkey on the computer as well as on the T68i. This passkey is necessary in order to establish a connection.

Entering a passkey
Entering a passkey

Once pairing is completed, you need to specify a serial port to use so that it can communicate between the two devices. To do so, click the Serial Ports tab and click New...:

Locating a device for communication

Click on Select Device ... to further select the serial port to use for communication:

Select a serial port

Once the serial port is selected, I am now ready to "talk" to my T68i.

Using the Ericsson Client

There is a handy application on the Internet called the Ericsson Client (version 1.0.0) The Ericsson Client is an application for Mac OS X that allows you to transfer files to and from your Ericsson phone using a cable or a wireless Infrared or Bluetooth connection. Developed by Jonas Salling, Ericsson Client is a shareware and folks who find it useful and use it should preferably pay for it ($10).

Accordingly, Ericsson Client is capable of the following:

And so I went on to download and install the Ericsson Client. After installation, you need to select from the Preferences window the serial port to use; else it will not be able to find your phone.

Specifying the serial port to use in Ericsson Client

If everything went well, you should see the following:

Ericsson Client connected to the T68i

To test the capabilities of the Ericsson Client. I copied a few background images and a few themes (free.)

Some background images for the T68i

Copying the themes and images to the T68i is then a matter of dragging and dropping them onto the window:

Transfer files to the T68i by dragging and dropping onto the image

Besides uploading images and themes, you can also perform a backup of your phone's calendar or phone book.

Files Transfers Between Macs and Devices

Another utility that came with the Technology Preview is Bluetooth File Exchange. This utility allows Macs and devices equipped with Bluetooth devices to perform file transfers. To transfer files between devices, simply drag the file(s) that you want to transfer and drop it onto the icon, and a dialog box will let you discover and choose other Bluetooth-enabled devices. You can use this utility to transfer files between Macs and PDAs such as Palm and Pocket PCs. For example, you can send a business card from a Palm handheld to a Mac.

File transfer using the Bluetooth File Exchange

Final Thoughts

So far I have only described one particular use of Bluetooth--connecting to my Ericsson T68i. However, there are many other Bluetooth uses: for example, you can connect to the Internet using the T68i as a GPRS modem. Another use would be to print wirelessly to a Bluetooth-enabled printer. Or a Bluetooth-equipped digital camera that sends images to the computer as soon as they are taken. The list goes on and on. While Bluetooth will not replace your AirPort (due to its lower throughput of 1Mbps versus AirPort's 11Mbps), be prepared to see more devices that are Bluetooth-enabled in the future! But for now, I am just glad my PC USB Bluetooth adapter works!

Wei-Meng Lee (Microsoft MVP) http://weimenglee.blogspot.com is a technologist and founder of Developer Learning Solutions http://www.developerlearningsolutions.com, a technology company specializing in hands-on training on the latest Microsoft technologies.


Return to Wireless DevCenter

Copyright © 2009 O'Reilly Media, Inc.