Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



How to set an attribute in a service record

Attributes in a service record are set or altered by calling RSdpDatabase::UpdateAttributeL().

Example

The following example adds an attribute with ID 102 hex (the attribute that specifies the service provider name in English) 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();

Note

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.