×
Namespaces

Variants
Actions

Creating a DM profile using Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Nokia E75
Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 3rd Edition FP2
S60 5th Edition
S60 5th Edition
S60 3rd Edition FP2
Article
Keywords: RSyncMLSession, RSyncMLDevManProfile
Created: User:Kbwiki (18 Jun 2010)
Last edited: hamishwillee (01 Aug 2012)

Note.pngNote: :This API is not part of the public SDK. It can be found in the SDK API Plug-in.

Contents

Overview

This article gives an overview of creating a DM profile programmatically.

Description

For configuring various settings remotely it is necessary to have a DM profile on the device. The server profile on the device helps in configuring APs, SIP/VoIP Settings, etc. remotely.

Solution

The SyncML Client API available in the SDK API Plug-in can be used for creating a DM profile. RsyncMLDevManProfile is the class for creating the DM profile. The following code snippet gives an overview of how to create a DM profile.


Headers required

#include<syncmlclient.h>
#include<syncmlclientdm.h>
#include<syncmldef.h>

Library to be included

LIBRARY syncmlclientapi.lib

Code Snippet for profile creation

 RSyncMLDevManProfile profile;
 profile.CreateL( syncMLSession );
 // To set profile display name
 profile.SetDisplayNameL(_L("Funambol"));
 // To set User name
 profile.SetUserNameL(_L8("funambol"));
 // To set password
 profile.SetPasswordL(_L8("funambol"));
 //To set Server Id
 profile.SetServerIdL(_L8("funambol"));
 //To set Server password
 profile.SetPasswordL(_L8("srvpwd"));
 // To set Protocol Version to be used when synchronizing
 TSmlProtocolVersion protocol = ESmlVersion1_1_2;
 profile.SetProtocolVersionL( protocol );
 // To sets the server-alerted notification user interaction.
 TSmlServerAlertedAction action = ESmlConfirmSync;
 profile.SetSanUserInteractionL( action );	
 // To save modifications
 profile.UpdateL();
 // close profile
 profile.Close();

The settings of an existing profile (or profiles) can be accessed as follows:

 RArray<TSmlProfileId> arr;
 RSyncMLDevManProfile profile;
 // Get the list of available profiles into an array
 TRAPD(err, syncMLSession.ListProfilesL(arr, ESmlDevMan));
 if (err == KErrNone)
    {
    TInt count = arr.Count(); 
    TBuf<20> proCount;
    proCount.AppendNum(count); //Gives available no. of DM profiles
    }
 TInt count;
 for (int i=0;i<arr.Count();i++)
     {
     TRAPD(error,profile.OpenL(syncMLSession,arr[i], ESmlOpenReadWrite));
     if(KErrNone != error)
      {
User::Leave(error);
} TBuf<50> displayName; //Gives the profile name displayName.Append(profile.DisplayName()); TBuf8<50> serverID; //Gives the server name serverID.Append(profile.ServerId()); //Other settings like profileId, username, password etc can also be //obtained in a simlar fashion // To save modifications profile.UpdateL(); // close profile profile.Close(); }

Required capabilities: WriteDeviceData ReadDeviceData ReadUserData WriteUserData LocalServices NetworkServices

Related articles

Get current SIM card status using Symbian C++

This page was last modified on 1 August 2012, at 04:39.
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.

×