Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: etel.h
Link against: etel.lib

Class RPhone

RPhone

Support

Supported from 5.0

Description

Phone sub-session.

Provides access to the functionality associated with a specific phone.

This class is not intended for user derivation.

Derivation

RPhonePhone sub-session
RTelSubSessionBaseA base class used in the derivation of RCall, RLine, and RPhone

Defined in RPhone:
Close(), EDetectedNotPresent, EDetectedPresent, EDetectedUnknown, EModeEstablishingLink, EModeIdle, EModeOnlineCommand, EModeOnlineData, EModeUnknown, EnumerateLines(), GetCaps(), GetInfo(), GetLineInfo(), GetStatus(), Initialise(), InitialiseCancel(), KCapsData, KCapsEventModemDetection, KCapsFaxClassOne, KCapsFaxClassOnePointZero, KCapsFaxClassTwo, KCapsFaxClassTwoPointOne, KCapsFaxClassTwoPointZero, KCapsStealCommPort, KCapsUnknown, KCapsVoice, NotifyCapsChange(), NotifyCapsChangeCancel(), NotifyModemDetected(), NotifyModemDetectedCancel(), NotifyOnAnything(), NotifyOnAnythingCancel(), Open(), RPhone(), TCaps, TCapsFlags, TLineInfo, TMode, TModemDetection, TPhoneInfo, TPhoneNotifyInfo, TStatus


Construction and destruction


RPhone()

RPhone();

Description

Empty default constructor.

Constructs an empty RPhone object, and is present only to support virtual function table export.

[Top]


Open/close phone requests


Open()

TInt Open(RTelServer& aSession,const TDesC& aName);

Description

Opens a phone subsession by name, and starts the modem initialisation process.

Note:

Parameters

RTelServer& aSession

A session, that must be connected to the server.

const TDesC& aName

The name of the phone to be opened

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


Close()

void Close();

Description

Closes the phone. This function must be called for all RPhone subsessions which have been opened — to prevent memory leakage.

[Top]


Initialisation functions

Description

Initialisation places the modem into a state in which it can receive commands, and in which the TSY can query its capabilities.


Initialise()

TInt Initialise();

Description

Initialises, or re-initialises, a phone — synchronous. If the function is called during the automatic initialisation, the function completes when the phone is initialised. If the function is called after the automatic initialisation has finished, the phone is re-initialised.

Initialisation may take significant time to complete.

Notes:

Return value

TInt

KErrNone if successful, otherwise one of the ETel Core error codes or another system-wide error codes. Specific ETel errors which might be returned are: KErrEtelInitialisationFailure and KErrEtelModemNotDetected.


Initialise()

void Initialise(TRequestStatus& aStatus);

Description

Initialises or re-initialises a phone — asynchronous.

If the function is called during the automatic initialisation, the function completes when the phone is initialised. If the function is called after the automatic initialisation has finished, the phone is re-initialised.

Initialisation may take significant time to complete.

Notes:

Parameters

TRequestStatus& aStatus

A variable that indicates the completion status of the request. ETel errors which might be returned are: KErrEtelInitialisationFailure and KErrEtelModemNotDetected.


InitialiseCancel()

void InitialiseCancel();

Description

Cancels a request to initialise the modem, placed using the asynchronous variant of the Initialise() function.

[Top]


Query functions


GetCaps()

TInt GetCaps(TCaps& aCaps) const;

Description

Gets the phone’s capabilities.

Parameters

TCaps& aCaps

On return, contains the phone capabilities.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


GetStatus()

TInt GetStatus(TStatus& aStatus) const;

Description

Gets information about the status of the phone.

Parameters

TStatus& aStatus

On return, contains the current phone status.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


EnumerateLines()

TInt EnumerateLines(TInt& aCount) const;

Description

Gets the number of lines associated with the phone.

Parameters

TInt& aCount

On return, contains the number of lines associated with the phone.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


GetLineInfo()

TInt GetLineInfo(const TInt aIndex,TLineInfo& aLineInfo) const;

Description

Gets enough information about a line to differentiate it from other lines associated with the phone.

Parameters

const TInt aIndex

The index of the line for which information is required.

TLineInfo& aLineInfo

On return, contains the line information.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


GetInfo()

TInt GetInfo(TPhoneNotifyInfo& aPhoneNotifyInfo) const;

Support

Supported from 5.0
Withdrawn in 5.1

Description

Gets a snapshot of the current phone information.

Note:

Parameters

TPhoneNotifyInfo& aPhoneNotifyInfo

On return, contains the current phone information

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


GetInfo()

TInt GetInfo(TPhoneInfo& aPhoneInfo) const;

Support

Supported from 5.1

Description

Gets a snapshot of the current phone information.

Note:

Parameters

TPhoneInfo& aPhoneInfo

On return, contains the current phone information

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

[Top]


Notification functions


NotifyModemDetected()

void NotifyModemDetected(TRequestStatus& aStatus,TModemDetection& aDetection);

Description

Provides notification when the local modem is detected, or when a previously connected modem can no longer be contacted.

Note:

Parameters

TRequestStatus& aStatus

A flag that indicates the completion status of the request.

TModemDetection& aDetection

On return, contains the new status.


NotifyModemDetectedCancel()

void NotifyModemDetectedCancel() const;

Description

Cancels an outstanding modem detection notification, placed using theNotifyModemDetected() function.


NotifyOnAnything()

void NotifyOnAnything(TRequestStatus& aStatus,TPhoneNotifyInfo& aPhoneNotifyInfo);

Support

Supported from 5.0
Withdrawn in 5.1

Description

Provides notification if the phone information changes.

Note:

Parameters

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

TPhoneNotifyInfo& aPhoneNotifyInfo

On request completion, contains the new phone information.


NotifyOnAnythingCancel()

void NotifyOnAnythingCancel() const;

Support

Supported from 5.0
Withdrawn in 5.1

Description

Cancels an "Any change" notification request, placed using theNotifyOnAnything() function.


NotifyCapsChange()

void NotifyCapsChange(TRequestStatus& aStatus, TCaps& aCaps);

Description

Provides notification of changes in phone capabilities.

Parameters

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

TCaps& aCaps

On request completion, contains the phone capabilities.


NotifyCapsChangeCancel()

void NotifyCapsChangeCancel() const;

Description

Cancels a "Capabilities change" notification request, placed using the NotifyCapsChange() function.

[Top]


Enumerations


Enum TCapsFlags

TCapsFlags

Description

Phone capability flags.

KCapsUnknown

The capabilities of the phone are not known.

KCapsData

The phone supports data calls.

KCapsFaxClassOne

The phone supports the fax class 1 interface.

KCapsFaxClassOnePointZero

The phone supports the fax class 1.0 interface.

KCapsFaxClassTwo

The phone supports the fax class 2 interface.

KCapsFaxClassTwoPointZero

The phone supports the fax class 2.0 interface.

KCapsFaxClassTwoPointOne

The phone supports the fax class 2.1 interface.

KCapsVoice

The phone supports voice calls.

KCapsEventModemDetection

The phone supports modem detection events, i.e. it can notify clients when the modem can be or can no longer be detected.

KCapsStealCommPort

The phone supports the ability to take the communications port from whatever component is currently using it.


Enum TMode

TMode

Description

Phone mode status flags.

EModeUnknown

Phone (modem) status unknown.

EModeIdle

Phone is idle.

EModeEstablishingLink

Phone is establishing link.

EModeOnlineData

Modem is in data mode.

EModeOnlineCommand

Modem is in command mode and the line is active.


Enum TModemDetection

TModemDetection

Description

Modem connection status flags.

EDetectedPresent

Modem present.

EDetectedNotPresent

Modem is not present.

EDetectedUnknown

Modem connection status is unknown.

[Top]


Struct


Struct TCaps

TCaps

Description

Phone capability information.

Defined in RPhone::TCaps:
iFlags

iFlags


TUint iFlags

Description

Phone capability flag. Contains bitmask of values defined in theTCapsFlags enumeration.


Struct TStatus

TStatus

Description

Current phone status.

Defined in RPhone::TStatus:
iMode, iModemDetected

iModemDetected


TModemDetection iModemDetected

Description

The current modem connection status. For values seeTModemDetection enumeration.

iMode


TMode iMode

Description

The current mode of the phone. For values, seeTModeenumeration


Struct TLineInfo

TLineInfo

Description

Line information.

Defined in RPhone::TLineInfo:
iLineCapsFlags, iName, iStatus

iStatus


RCall::TStatus iStatus

Description

The current line status.

iLineCapsFlags


TUint32 iLineCapsFlags

Description

The line capabilities flag.

iName


TName iName

Description

The name of the line.

[Top]


Class RPhone::TPhoneNotifyInfo

RPhone::TPhoneNotifyInfo

Support

Supported from 5.0
Withdrawn in 5.1

Description

Phone notification information

Collects all the information associated with an instance of the core API phone class is collected together into a single, directly accessible, structure. This increases the efficiency of applications that require access to the majority of the phone's data.

This class is not intended for user derivation.

Defined in RPhone::TPhoneNotifyInfo:
TPhoneNotifyInfo(), iDetection, iDetectionChanged

[Top]


Construction and destruction


TPhoneNotifyInfo()

RPhone::TPhoneNotifyInfo();

Description

Empty constructor.

[Top]


Data members


iDetection

TModemDetection iDetection

Description

The current modem detection state (is it present or not).


iDetectionChanged

TBool iDetectionChanged

Description

An indication that the modem detection state has changed since the last notification.

[Top]


Class RPhone::TPhoneInfo

RPhone::TPhoneInfo

Support

Supported from 5.1

Description

Phone notification information.

Collects all the information associated with an instance of the core API phone class is collected together into a single, directly accessible, structure. This increases the efficiency of applications that require access to the majority of the phone's data.

This class is not intended for user derivation.

Defined in RPhone::TPhoneInfo:
TPhoneInfo(), iDetection

[Top]


Construction and destruction


TPhoneInfo()

RPhone::TPhoneInfo();

Description

Empty constructor.

[Top]


Data members


iDetection

TModemDetection iDetection

Description

The current modem detection state (is it present or not).