EPOC   SDK Home Glossary Indexes Previous Next Up

RPhone class


Contents


RPhone class — Phone sub-session

Section Contents


Overview

Compatibility

Applications that use this class will not work correctly on a version of EPOC earlier than ER5.

Derivation

RTelSubSessionBase

Abstract: implements a subsession

Defined in

etel.h

Link against

etel.lib

Description

The phone sub-session provides access to the functionality associated with a specific phone.

Writing derived classes

This class is not intended for user derivation.


Construction and destruction


RPhone() — Empty default constructor

RPhone();

Description

The constructor is empty, and is present only to support virtual function table export: see Implications of static DLLs.


Open/Close phone requests

      


Open() — Open phone

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

Description

This function opens a phone subsession by name, and starts the modem initialisation process.

Arguments

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

An error code: see System error codes.

Notes

Close() — Close phone

void Close();

Description

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


Initialisation functions

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


Initialise() — Phone initialisation (synchronous)

TInt Initialise();

Description

This asynchronous function initialises, or re-initialises, a phone. 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.

Return value

TInt

An error code: see Error codes.

Errors which might be returned are: KErrEtelInitialisationFailure and KErrEtelModemNotDetected.

Notes:

Initialise() — Phone initialisation (asynchronous)

void Initialise(TRequestStatus& aStatus);

Description

This asynchronous function initialises, or re-initialises, a phone. 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.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

Errors which might be returned are: KErrEtelInitialisationFailure and KErrEtelModemNotDetected.

Notes:

InitialiseCancel() — Cancel initialisation request

void InitialiseCancel();

Description

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


Query functions


GetCaps() — Get phone capabilities

TInt GetCaps(TCaps& aCaps) const;

Description

This function retrieves the phone’s capabilities.

Arguments

TCaps& aCaps

On return, contains the phone capabilities.

Return value

TInt

An error code: see System error codes.


GetStatus() — Get phone status information

TInt GetStatus(TStatus& aStatus) const;

Description

This function retrieves information about the status of the phone.

Arguments

TStatus& aStatus

On return, contains the current phone status.

Return value

TInt

An error code: see System error codes.


EnumerateLines() — Get number of lines associated with phone

TInt EnumerateLines(TInt& aCount) const;

Description

This function returns the number of lines associated with the phone.

Arguments

TInt& aCount

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

Return value

TInt

An error code: see System error codes.


GetLineInfo() — Get line information

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

Description

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

Arguments

const TInt aIndex

The index of the line for which information is required.

TLineInfo& aLineInfo

On return, contains the line information.

Return value

TInt

An error code: see System error codes.


GetInfo() — Get current phone information

TInt GetInfo(TPhoneNotifyInfo& aPhoneNotifyInfo) const;

Description

This function retrieves a snapshot of the current phone information.

Arguments

TPhoneNotifyInfo& aPhoneNotifyInfo

On return, contains the current phone information

Return value

TInt

An error code: see System error codes.

Notes

Notification functions


NotifyModemDetected() — Modem detection notification

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

Description

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

Arguments

TRequestStatus& aStatus

A flag that indicates the completion status of the request.

TModemDetection& aDetection

On return, contains the new status.

Notes:

NotifyModemDetectedCancel() — Cancel modem detection notification

void NotifyModemDetectedCancel() const;

Description

This function cancels an outstanding modem detection notification, placed using the NotifyModemDetected() function.


NotifyOnAnything() — Notification of any changes to the phone information

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

Description

This function provides notification if the phone information changes.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

TPhoneNotifyInfo& aPhoneNotifyInfo

On request completion, contains the new phone information.

Notes:

NotifyOnAnythingCancel() — Cancel notification of phone information

void NotifyOnAnythingCancel() const;

Description

This function cancels an "Any change" notification request, placed using the NotifyOnAnything() function.


NotifyCapsChange() — Notification of phone capability changes

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

Description

This function provides notification of changes in phone capabilities.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

TCaps& aCaps

On request completion, contains the phone capabilities.


NotifyCapsChangeCancel() — Cancel notification of phone capability changes

void NotifyCapsChangeCancel() const;

Description

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


Enumerations


TCapsFlags enum — 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.


TMode enum — 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.


TModemDetection enum — Modem connection status flags

EDetectedPresent

Modem present.

EDetectedNotPresent

Modem is not present.

EDetectedUnknown

Modem connection status is unknown.


Struct


TCaps struct — Phone capability information

TUint iFlags

Phone capability flag. Contains bitmask of values defined in the TCapsFlags enumeration.


TStatus struct — Current phone status

TModemDetection iModemDetected

The current modem connection status. For values see TModemDetection enumeration.

TMode iMode

The current mode of the phone. For values, see TMode enumeration


TLineInfo struct — Line information

RCall::TStatus iStatus

The current line status.

TUint32 iLineCapsFlags

The line capabilities flag.

TName iName

The name of the line.


RPhone::TPhoneNotifyInfo class — Phone notification information

Section Contents


Overview

Compatibility

Applications that use this class will not work correctly on a version of EPOC earlier than ER5.

Derivation

RPhone::TPhoneNotifyInfo

Provides structure to contain phone notification information.

Defined in

etel.h

Link against

etel.lib

Description

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.

Writing derived classes

This class is not intended for user derivation.


Construction and destruction


TPhoneNotifyInfo() — Empty constructor

RPhone::TPhoneNotifyInfo();

Description

The constructor is empty.


Data members

TModemDetection iDetection

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

TBool iDetectionChanged

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

EPOC       SDK Home Glossary Indexes Previous Next Up