Attributes in a service record are set or altered by calling
RSdpDatabase::UpdateAttributeL()
.
The following example adds an attribute with ID 0x0102, the attribute
that specifies the service provider name (0x0002 for the
ProviderName attribute plus the language base offset, which for
the primary language is 0x0100), in the service record identified by
recordHandle
:
// Assumes sdpSubSession is an open subsession to the database,
// and recordHandle is the service record
_LIT8(KProvName,"Symbian Ltd.");
CSdpAttrValueString* attrVal = CSdpAttrValueString::NewStringL(KProvName);
CleanupStack::PushL(attrVal);
sdpSubSession.UpdateAttributeL(recordHandle, 0x0102, *attrVal);
CleanupStack::PopAndDestroy();
UpdateAttributeL()
places no constraints on the contents of
service records, and allows attributes of any value or content. You should
ensure that the correct attribute IDs are used.
The complete set of Service Discovery Database tutorials are shown below:
Setting service record attributes - This document
Also refer to the Bluetooth Service Discovery Database overview and the Bluetooth SDP Overview for additional background information.