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.
Getting product information remotely using Bluetooth device identification profile
This article provides information about the Bluetooth device identification profile for additional information above and beyond the Bluetooth Class of Device. Device identification profile is dependent on, and an extension of, the behaviors defined by the Service Discovery Protocol (SDP). There is a complete Symbian C++ example that can be used to test and check the remote device information.
Device identification information for the device is exported in terms of an explicit SDP record on the device. This is called the device identification service record, and is identified by a unique UUID – this UUID is called PNPInformation and it is part of the Bluetooth assigned numbers. This SDP record can be queried by remote devices and it contains additional information about the device. The additional information includes Specification ID, Vendor ID, Product ID, Version, etc. Device manufacturers include this information in their devices. Nokia supports the device identification profile from S60 5th edition onwards, including some S60 3rd Edition, Feature Pack 2 devices as well.
How to find device information
Symbian C++ provides an API for getting SDP records.
A service search returns the record handles of services that are of a specified class or classes (identified by UUID numbers). We create a CSdpSearchPattern object to specify the service classes to search for and create a CSdpAttrIdMatchList object in which to specify the attributes to be retrieved.
iSdpSearchPattern = CSdpSearchPattern::NewL();
For more information, see the Service discovery page at www.bluetooth.org (registration required).
iMatchList = CSdpAttrIdMatchList::NewL();
void CSdpPropertySearcher::AttributeRequestResult(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID,CSdpAttrValue* aAttrValue)
iAttrBuffer.AppendFormat(_L("\r\nSpec ID: 0x%04x\r\n"),val);
iAttrBuffer.AppendFormat(_L("\r\nVendor ID: 0x%04x\r\n"),val);
iAttrBuffer.AppendFormat(_L("\r\nProduct ID: 0x%04x\r\n"),val);
iAttrBuffer.AppendFormat(_L("\r\nVersion ID: 0x%04x\r\n"),val);
iAttrBuffer.AppendFormat(_L("\r\n 0x204 to 0x205\r\n"));
We can check if the remote device supports DI profile by running this example. This example can be run on any Nokia S60 3rd to 5th edition device. If the remote device supports ID profile, this example will show the attributes (version, manufacturer, model, etc.) of this record. If the remote device does not support this profile, it will not show any records. File:BTIdProfile.zip