MacDevCenter    
 Published on MacDevCenter (http://www.macdevcenter.com/)
 See this if you're having trouble printing code examples


What Is Bluetooth

by Michael Juntao Yuan, author of Nokia Smartphone Hacks
11/18/2005
Bluetooth
Bluetooth is a low-power-consumption and short-range wireless technology for personal area networks (PANs). It connects your personal electronic devices, such as laptops, mobile phones, digital cameras, audio equipments, and printers, without the clutter of cables. The Swedish telecom giant Ericsson originally developed Bluetooth. The name is inspired by King Harold Bluetooth, known for his unification of previously warring tribes from Denmark, Norway, and Sweden. Likewise, the Bluetooth technology was intended to unify and connect different personal electronic devices.

In This Article:

  1. What Can You Do with Bluetooth?
  2. Bluetooth Technology
  3. How to Use Bluetooth
  4. The Future of Bluetooth

With Bluetooth, you can place gadgets wherever you want, and finally have a clean office desk. But perhaps more importantly, Bluetooth saves time and improves mobility by supporting a portable network anywhere. You do not have to stop, sit down, and mess with the cables in order to use your electronics. This portable personal network is typically anchored in a smartphone or laptop computer. To fully understand the power of Bluetooth, let's first check out some common use cases for the Bluetooth technology.

What Can You Do with Bluetooth?

Supported by almost all electronics and computer vendors, Bluetooth can be found everywhere. The following is just a partial list of uses of Bluetooth today.

There are many other use cases that I cannot cover in the limited space of this article. For any specific use case, it might seem that it is not a big deal to use a cable connection instead of a Bluetooth wireless connection. But if you have multiple devices that need to communicate with each other, the number of cables increases geometrically as the number of the devices does. Bluetooth becomes more and more important as we carry more and more personal gadgets. The Bluetooth solution is especially useful for smartphones, as most smartphones use non-standard and expensive data cables.

To take advantage of Bluetooth devices and applications, we need to learn a little about technology behind Bluetooth.

Nokia Smartphone Hacks

Related Reading

Nokia Smartphone Hacks
Tips & Tools for Your Smallest Computer
By Michael Juntao Yuan

Bluetooth Technology

The Bluetooth network uses an unlicensed radio frequency at 2.45 GHz. It is the same frequency used by WiFi networks, cordless phones, and microwave ovens. A Bluetooth device typically has a range of ten meters (32 feet), and a data rate close to 300kbps. Since the 2.45GHz radio wave can penetrate walls, you can connect Bluetooth devices across rooms.

Ad Hoc Network

Bluetooth networks are ad hoc networks. A Bluetooth device automatically detects devices within its range and forms networks with them. If a device goes out of range, the network automatically drops its membership.

The details of the Bluetooth network topology and discovery protocols are not important for most users. You just need to know that once a Bluetooth device joins a network, it can "see" all devices in the network. And Bluetooth networks can connect to each other via bridge devices. For instance, in a very large conference hall, the localized Bluetooth networks (devices within a ten-meter radius) can join each other and form a big network that covers the entire hall (much larger than ten meters). When a device at one of the end of the hall communicates with a device at the other end, the traffic might be relayed via several bridge devices. Any Bluetooth device can become the bridge, and the device owner does not need to know whether his/her device is a bridge--it is all done transparently at the network level.

Context Exchange Protocols

Most Bluetooth-enabled computers, PDAs, and smartphones support the basic serial communication profile. Potentially, Bluetooth applications on those devices can exchange arbitrary complex data via the serial port interface.

The Bluetooth specification defines not only low-level radio communication protocols, but also high-level content exchange protocols, known as profiles. Two Bluetooth devices supporting the same profile can exchange content with each other. For instance, a mobile phone and its wireless audio headset support the headset profile; Bluetooth digital cameras, including camera phones, and Bluetooth portable printers support the printing profile; PDAs, smartphones, and PCs support the synchronization profile for address book/calendar/to-do list/email synchronization; mobile phones supporting the dial-up network profile can be used as wireless modems for laptop computers; devices that exchanges file with each other, such as a smartphone, a PDA, a camera, and a PC, support the file transfer profile.

For your Bluetooth device, you can find its supported profiles, and how to set it up to work with other devices, in the owner's manual. You can also find out more information about Bluetooth profiles from this website.

Bluetooth SIG

As a network protocol uniting many different types of devices, Bluetooth is only useful when it enjoys wide industry support. In reality, Bluetooth is an industry standard supported by all major electronics and computer vendors. The industry-wide collaboration of Bluetooth is done through a forum called the Bluetooth Special Information Group (SIG). You can find Bluetooth specification documents and a list of Bluetooth devices on its website.

How to Use Bluetooth

To use Bluetooth, you have to set up the devices and authenticate them with each other. The exact instructions, obviously, are different for each device, and you have to look them up in the device's manual. However, the same general principles apply. Below is a brief overview of the process.

Devices and Drivers

By default, Bluetooth is turned off on most handheld devices in order to reduce power consumption.

For most Bluetooth-compatible handheld devices, such as smartphones or PDAs, you do not need to install additional hardware or software to enable Bluetooth. You just need to navigate to the connectivity configuration menu on the device UI, and turn on the Bluetooth radio. Once Bluetooth is on, you can typically see a Bluetooth symbol or a small black dot on the idle screen. The device also has built-in Bluetooth utility software for changing the device name, changing the discovery mode, authenticating with other devices, sending files/messages, etc.

For computers, setting up Bluetooth is a little more complex. You first need to make sure that there is Bluetooth hardware installed on the computer. If not, you can easily purchase a USB-based Bluetooth dongle and just plug it in. If you do not want the dongle to stick out of your computer or have no spare USB port, you can purchase a Bluetooth card that can be installed inside of the computer. Different operating systems provide different levels of support for Bluetooth hardware.

Since the Bluetooth drivers in the operating system must support Bluetooth profiles, those drivers come with native utilities for communication tasks defined in the profiles, such as device authentication, business card/file transfer, PIM synchronization, and so on. Nokia Smartphone Hacks covers details on how to set up Bluetooth on Mac, Windows, and Linux computers to connect to a smartphone.

Authentication and Pairing

Due to the dynamic nature of Bluetooth networks, you can often find devices owned by total strangers joining your network in a crowded room. To ensure security and privacy, Bluetooth devices are typically required to authenticate with each other before they can exchange data. The simplest form of authentication is to ask for the user's explicit approval. For instance, if you send a business card or photo from one smartphone to another, the recipient device would prompt its owner to "accept the incoming data item" by explicitly acknowledging a pop-up alert box on the screen.

For long-running data exchanges, such as PIM synchronization, hands-free operation, and dial-up networking, we cannot require manual approval for each data item exchanged. Those operations also typically transfer sensitive data that need more protection than simple recipient acknowledgment. In those cases, we need to establish a trusted relationship between two Bluetooth devices by pairing them. You can initiate pairing from any device by selecting the "pair/set up new device" menu in the Bluetooth utility software. The initiating device searches for all Bluetooth devices nearby and ask you to select a recipient device from the search results. You will be promoted enter a random security code (i.e., a PIN) on the initiating device. The recipient device would then receive a pairing quest and prompt you for the security code you just entered on the initiating device. Once the security code is confirmed, the two devices are paired.

Security

Security is an important issue in Bluetooth networks, given the ad hoc nature of network membership. The Bluetooth specification is designed with security in mind. You are required to authenticate or even pair devices for certain tasks. And communication data between paired devices can be encrypted. However, individual devices might still have weaknesses in their Bluetooth implementation, which would allow Bluetooth attacks ranging from harmless pranks to serious data theft or device-crippling viruses. Here are some typical Bluetooth attack scenarios:

To prevent Bluetooth attacks, you could turn off your Bluetooth radio or make your device invisible by turning off the discovery mode. You can also install anti-virus software or even use a Bluetooth firewall to filter out unwanted traffic.

The Future of Bluetooth

Bluetooth evolved from a cable replacement technology for existing applications. It is now a ubiquitous personal area network technology enabling applications never possible in the cable world (e.g., social networking and remote control). The Bluetooth SIG is working with other standards bodies, including Ultra Wide Band (UWB) specification committees, to develop the next-generation Bluetooth technology. It could cover areas up to 100 meters, and have a data rate exceeding 100Mbps, making it suitable for streaming high-quality video contents in your home. The best of Bluetooth is still ahead of us.

Michael Juntao Yuan specializes in lightweight enterprise / web application, and end-to-end mobile application development.


Return to the Mac DevCenter

Copyright © 2009 O'Reilly Media, Inc.