Retrieving remote Bluetooth device information using Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Tested with
Devices(s): All (S60)
Keywords: TBTDeviceClass
Created: User:Technical writer 1 (27 Nov 2008)
Last edited: lpvalente (17 Aug 2014)



Applications can retrieve certain Bluetooth-specific information about remote Bluetooth devices. This information can be used, for example, to filter out certain devices or device classes to optimise the otherwise time-consuming service search.


When Bluetooth is switched on, the device promotes its Class of Device/Service characteristics that another device can retrieve in the device discovery procedure. These characteristics indicate the major and minor device class (for example, phone and smartphone, respectively), and general service classes (for example, networking, object transfer, and audio). Note that this is a high-level categorisation of public services and there is also a concept of Bluetooth profiles and services that should be used by applications to ensure compatibility (for more information on how to discover services, see Archived:Discovering Bluetooth services using Symbian C++.


In the device discovery, a Socket address class TInquirySockAddr of each remote device is retrieved and TBTDeviceClass (defined in btdevice.h) can be constructed from it. TBTDeviceClass holds information on MajorServiceClass, MajorDeviceClass, and MinorDeviceClass. They can be retrieved as follows:

   // Issue request
iHostResolver.GetByAddress( iInquirySockAddr, iEntry, iStatus );
//Receive result in RunL()
if( iStatus == KErrNone)
TInquirySockAddr& sa = TInquirySockAddr::Cast( iEntry().iAddr );
TBTDeviceClass tmpDeviceClass( sa.MajorServiceClass(),
sa.MajorClassOfDevice(), sa.MinorClassOfDevice());

Note that there are no direct Bluetooth APIs to retrieve any other device-specific information such as IMEI or phone number. You always need a counter application running on the remote device to query such information of the device.

Additional information

General information on Class of Device/Service is provided in the Bluetooth specification available for registered Bluetooth SIG members at www.bluetooth.org.

This page was last modified on 17 August 2014, at 18:40.
117 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.