Publishing and checking visibility of Bluetooth Serial Port Profile (SPP)
S60 5th Edition
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
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();
iAgent = CSdpAgent::NewL(*this, aAddress);
iAgent->NextRecordRequestL(); //Properties of SPP will be retrieved