Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Enabling Bluetooth Limited Inquiry (LIAC) using Symbian C++

From Wiki
Jump to: navigation, search
Article Metadata
Code ExampleTested with
Devices(s): Nokia N95
Nokia E90 Communicator
Keywords: TInquirySockAddr, RProperty
Created: tepaa (22 Feb 2008)
Last edited: hamishwillee (30 May 2013)



This code snippet shows how to add Limited Inquiry Access Code (LIAC) support to the S60 Platform: Bluetooth Point-to Multipoint Example. A separate patch package is given at the end of the article.

In the Bluetooth Specification there are two different inquiry access codes for different use cases: Limited Inquiry Access Code (LIAC) and Generic Inquiry Access Code (GIAC). The default inquiry method is Generic Inquiry (GIAC) that finds all the visible devices. By default the listening devices are of type Discoverable, which means that they are scanning with GIAC.

You can set both the inquiry and the scanning method into LIAC mode. When making a device inquiry with LIAC, devices are found considerably faster because only those devices which are in LIAC mode are found and other normal discoverable devices are filtered out. Because fewer devices are found, this also speeds up the subsequent service discovery procedure performed on discovered devices.

Limited Inquiry (LIAC) is useful in cases where an application is running on two or more devices and connection is desired only between these devices. Devices scanning with LIAC can be found by devices inquiring with LIAC or GIAC (LIAC inquiries are prioritized).

Devices inquiring with LIAC can only find devices scanning with LIAC.

Note: After the changes described in this code snippet, the application needs to be signed via the Open Signed process. More information about Open Signed is available at Symbian Signed.


Limited Device Status can only be enabled on S60 3rd Edition or higher.

MMP file

The following capabilities are required:

CAPABILITY  LocalServices
CAPABILITY  NetworkControl
CAPABILITY  WriteDeviceData

Header file: BluetoothPMPExampleEngine.h

Add these lines to the existing header (BluetoothPMPExampleEngine.h):

#include <e32property.h> // RProperty
RProperty iProperty;

Source file: BluetoothPMPExampleEngine.cpp

From S60 3rd Edition onwards, the discoverability is set via the Bluetooth Publish and Subscribe API using a constant KPropertyKeyBluetoothSetLimitedDiscoverableStatus.

To set the listening device to Limited-Discoverable mode, add this code to the end of CBluetoothPMPExampleEngine::ConstructL():

// Define Limited-Discoverable mode
TInt attErr = iProperty.Define(KPropertyUidBluetoothControlCategory,
if (attErr != KErrNone && attErr != KErrAlreadyExists)
// Turn Limited-Discoverable mode on
KPropertyKeyBluetoothSetLimitedDiscoverableStatus, ETrue));

Remember to close RProperty in the destructor (CBluetoothPMPExampleEngine::~CBluetoothPMPExampleEngine()):


Header file: DeviceDiscoverer.h

Add these lines to the existing header (DeviceDiscoverer.h):

#include <bttypes.h> // KLIAC constant

Source file: DeviceDiscoverer.cpp

To change the discovering device from Generic Inquiry to Limited Inquiry, add the following to the CDeviceDiscoverer::DiscoverDevicesL() function:



S60 Platform: Bluetooth Point-to-Multipoint Example has been changed to support Limited Inquiry.


File:BtPMPEx LIAC Patch against S60 Platform: Bluetooth Point-to Multipoint Example

The patch package contains:

This page was last modified on 30 May 2013, at 04:33.
43 page views in the last 30 days.