Bluetooth and infrared

Bluetooth and infrared are short-range connection technologies that require hardware support in mobile devices.

Bluetooth

Bluetooth has been standardised by the Bluetooth Special Interest Group (SIG). For a device to support Bluetooth technology, it must comply with the Bluetooth specifications.

Data transmission over a Bluetooth connection takes place over the technology's own protocols. Since Bluetooth communication requires a Bluetooth chip in the mobile device, your application needs to check that Bluetooth is supported and that the chip is turned on.

Note: Remember to take power consumption issues into account when implementing Bluetooth communication in your application.

Bluetooth enabled devices can have one of the following three states:

  • Visible to all

  • Hidden

  • Off

The process of transmitting data through a Bluetooth connection includes the following steps:

  • Search for visible devices in range.

    Note: You can search for devices based on available Bluetooth services. In this context, the term service indicates the functionality provided by the Bluetooth enabled application.

  • Connect to the desired device.

    Typically, Bluetooth connections are established between two devices, but it is also possible for a device to establish multiple Bluetooth connections.

  • Depending on the application settings, connecting may require device authentication using a link key.

    In the first authentication, called pairing, the devices exchange their link keys, which are then stored on the devices. Later, authentication is accomplished using the stored key, and a connection can be made without device discovery, even if the remote device has been hidden.

  • Depending on the application settings, connecting may require an authorization procedure, where the mobile device user needs to accept the connection request manually.

    It is possible for the user mark the remote device as trusted, which enables future connections directly without user interaction.

  • Transfer data through the Bluetooth connection.

  • Close the Bluetooth connection.

To differentiate your application and to allow remote devices to discover it, it is recommended that you advertize your Bluetooth services. For example, if a third-party application sends data to your application using OBEX and your application is not running or advertizing its services, then another application, such as Messaging, may receive the data instead. For more information on advertizing Bluetooth services, see S60 Platform: Bluetooth API Developer's Guide available on Forum Nokia.

Mobile device applications can also set security requirements for connections to their Bluetooth services. The requirements define whether connections to a Bluetooth service need to include user authentication or authorization or data encryption. Typically, the device that accepts the connection request sets these requirements. However, it is also possible for the initiating application to set security requirements for outgoing Bluetooth connections when defining the link, for example when connecting to a PC.

Infrared

Infrared has been standardised by the Infrared Data Association (IrDA). For a device to support infrared technology, it must comply with IrDA specifications. Data transmission over an infrared connection takes place over the infrared protocols.