×
Namespaces

Variants
Actions

Sending USSD commands

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Code ExamplePlatform Security
Signing Required: DevCert
Capabilities: CommDD ReadDeviceData WriteDeviceData NetworkControl SwEvent NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment
Article
Keywords: RCommServ, RComm
Created: manchb (21 Dec 2007)
Last edited: hamishwillee (30 May 2013)

This article explains how to send USSD commands using AT commands.

Introduction

How to dial a string (with pause characters) explains how to Dial a string in S60 3rd edition using CPhCltDialer and TPhCltExtPhoneDialData. This does not work on S60 3rd edition Feature Pack 1.

This article shows how to workaround this problem. The solution is to send USSD commands using AT commands (APIs used are RCommServ and RComm).


Code

Header Files:

C32COMM.H


Libraries:

c32.lib


Capabilities:

CommDD ReadDeviceData WriteDeviceData NetworkControl SwEvent NetworkServices LocalServices

ReadUserData WriteUserData UserEnvironment


code Examples

Initializing code


_LIT(KCsyName,"DATAPORT");
_LIT(KDataPort,"DATAPORT::1");// this works with CUSD
//Start the service to the RCommServ
User::LeaveIfError(StartC32());
RCommServ iCommServer;
// Connect the server
User::LeaveIfError(iCommServer.Connect());
// Load the CSY module
User::LeaveIfError(iCommServer.LoadCommModule(KCsyName()));
RComm iComm;
// Open the port
User::LeaveIfError(iComm.Open (iCommServer, KDataPort, ECommShared));


Issue Request Code

Sending Ordinary Message

_LIT(KTestCommandEnd,"\r\n");
//iSendString has the data which is entered through a Dialog Box
//It should be appended with KTestCommandEnd
iSendString.Append(KTestCommandEnd);
iReplyData.Copy(iSendString);
//We write this information to the serial port
iComm.Write(iStatus,iReplyData);
SetActive();

Handling code after the Request is done

_//Reset the Buffer to read more information
iReplyData.Zero();
//Issue Request for more Information
iComm.ReadOneOrMore(iStatus, iReplyData);
SetActive();

Releasing code

iComm.Close();
iCommServer.Close();

The following is the document which describes how to pass AT commands for Call Waiting and Forwarding:
File:AT-Commands.doc


Example Project

File:Send AT Commands.zip

This page was last modified on 30 May 2013, at 04:38.
86 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.

×