Publishing and checking visibility of Bluetooth Serial Port Profile (SPP)

From Nokia Developer Wiki
Jump to: navigation, search

Article Metadata
Tested with
Devices(s): All (S60)
Platform(s): S60 3rd Edition
S60 5th Edition
Keywords: n/a
Created: User:Kbwiki (02 Jul 2010)
Last edited: hamishwillee (30 May 2013)


The Serial Port Profile (SPP) defines the protocols and procedures that are to be used by devices using Bluetooth for RS-232 (or similar) serial cable emulation. Many useful services are built using profiles that are dependent on the Serial Port Profile, such as Object Push Profile (OPP), Basic Imaging Profile (BIP), and Headset Profile (HS). The Serial Port Profile is also useful when communicating with PC applications.

Most Symbian devices do not publish SPP for remote devices, though they support and publish many profiles based on it. If a device supports the RFCOMM protocol, it still supports the Serial Port Profile even though it may not be visible by default. Hence, remote applications may connect to a Symbian device over SPP if there is an application running on the device publishing its SPP-based service.

3rd party applications can publish their service based on SPP as follows:

    TSdpServRecordHandle recordHandle = 0;
TUUID uuid(0x22222); // service class UUID 0x22222 for example
sdpSubSession.CreateServiceRecordL(uuid, recordHandle);

Note that the serial port is application-dependent, meaning that service class, service name, and service description are application-specific.

The following code can be used to check whether a remote device has published the Serial Port Profile:

    iSdpSearchPattern = CSdpSearchPattern::NewL();    
iMatchList = CSdpAttrIdMatchList::NewL();
iMatchList->AddL(TAttrRange(0x0000, 0xffff));
iAgent = CSdpAgent::NewL(*this, aAddress);
iAgent->NextRecordRequestL(); //Properties of SPP will be retrieved
This page was last modified on 30 May 2013, at 07:35.
37 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.