RPhone Class Reference

class RPhone : public RTelSubSessionBase

Phone sub-session.

Provides access to the functionality associated with a specific phone.

This class is not intended for user derivation.

Public Member Functions
RPhone()
IMPORT_C voidClose()
IMPORT_C TIntEnumerateLines(TInt &)
IMPORT_C TIntGetCaps(TCaps &)
IMPORT_C TIntGetInfo(TPhoneInfo &)
IMPORT_C TIntGetLineInfo(const TInt, TLineInfo &)
IMPORT_C TIntGetStatus(TStatus &)
IMPORT_C TIntInitialise()
IMPORT_C voidInitialiseCancel()
IMPORT_C voidNotifyCapsChange(TRequestStatus &, TCaps &)
IMPORT_C voidNotifyCapsChangeCancel()
IMPORT_C voidNotifyModemDetected(TRequestStatus &, TModemDetection &)
IMPORT_C voidNotifyModemDetectedCancel()
IMPORT_C TIntOpen(RTelServer &, const TDesC &)
IMPORT_C TIntSetEmergencyClient(const TUint32)
Protected Member Functions
IMPORT_C voidConstructL()
IMPORT_C voidDestruct()
Inherited Functions
RSubSessionBase::CloseSubSession(TInt)
RSubSessionBase::CreateAutoCloseSubSession(RSessionBase &,TInt,const TIpcArgs &)
RSubSessionBase::CreateSubSession(const RSessionBase &,TInt)
RSubSessionBase::CreateSubSession(const RSessionBase &,TInt,const TIpcArgs &)
RSubSessionBase::RSubSessionBase()
RSubSessionBase::Send(TInt)const
RSubSessionBase::Send(TInt,const TIpcArgs &)const
RSubSessionBase::SendReceive(TInt)const
RSubSessionBase::SendReceive(TInt,TRequestStatus &)const
RSubSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSubSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSubSessionBase::Session()const
RSubSessionBase::SubSessionHandle()const
RTelSubSessionBase::Blank(const TInt,TReqPriorityType)const
RTelSubSessionBase::Blank(const TInt,TRequestStatus &,TReqPriorityType)const
RTelSubSessionBase::CancelAsyncRequest(TInt)const
RTelSubSessionBase::CancelReq(const TInt,const TInt)const
RTelSubSessionBase::CancelSubSession()const
RTelSubSessionBase::Get(const TInt,TDes16 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TDes8 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TDes8 &,TDes8 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TDes8 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TRequestStatus &,TDes16 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TRequestStatus &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TRequestStatus &,TDes8 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TRequestStatus &,TDes8 &,TDes8 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TRequestStatus &,TDes8 &,TReqPriorityType)const
RTelSubSessionBase::RTelSubSessionBase()
RTelSubSessionBase::ResetSessionHandle()
RTelSubSessionBase::SessionHandle()const
RTelSubSessionBase::Set(const TInt,TRequestStatus &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,TRequestStatus &,const TDesC16 &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,TRequestStatus &,const TDesC8 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,TRequestStatus &,const TDesC8 &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,TRequestStatus &,const TDesC8 &,const TDesC8 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const RFile &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const TDesC16 &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const TDesC8 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const TDesC8 &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const TDesC8 &,const TDesC8 &,TReqPriorityType)const
RTelSubSessionBase::SetAndGet(const TInt,TRequestStatus &,TDes8 &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::SetAndGet(const TInt,TRequestStatus &,const TDesC16 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::SetAndGet(const TInt,TRequestStatus &,const TDesC8 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::SetAndGet(const TInt,TRequestStatus &,const TDesC8 &,TDes8 &,TReqPriorityType)const
RTelSubSessionBase::SetSessionHandle(RSessionBase &)
RTelSubSessionBase::SubSessionHandle()
Public Member Enumerations
enumTCapsFlags {
KCapsUnknown = 0x00000001, KCapsData = 0x00000002, KCapsFaxClassOne = 0x0000004, KCapsFaxClassOnePointZero = 0x0000008, KCapsFaxClassTwo = 0x00000010, KCapsFaxClassTwoPointZero = 0x00000020, KCapsFaxClassTwoPointOne = 0x00000040, KCapsVoice = 0x00000080, KCapsEventModemDetection = 0x00010000, KCapsStealCommPort = 0x00020000
}
enumTEmergencyRequest { EEmergencyLCSRequest = 0x00000001, EEmergencyCSVoiceCallRequest = 0x00000002 }
enumTMode { EModeUnknown, EModeIdle, EModeEstablishingLink, EModeOnlineData, EModeOnlineCommand }
enumTModemDetection { EDetectedPresent, EDetectedNotPresent, EDetectedUnknown }
Inherited Enumerations
RTelSubSessionBase:TReqPriorityType
Inherited Attributes
RTelSubSessionBase::iPtrHolder

Constructor & Destructor Documentation

RPhone()

IMPORT_CRPhone()

Empty default constructor.

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

Member Functions Documentation

Close()

IMPORT_C voidClose()

ConstructL()

IMPORT_C voidConstructL()[protected, virtual]
capability
None

Destruct()

IMPORT_C voidDestruct()[protected, virtual]
capability
None

EnumerateLines(TInt &)

IMPORT_C TIntEnumerateLines(TInt &aCount)const

Gets the number of lines associated with the phone.

RPhone::GetLineInfo()
capability
None

Parameters

TInt & aCountOn return, contains the number of lines associated with the phone.

GetCaps(TCaps &)

IMPORT_C TIntGetCaps(TCaps &aCaps)const

Gets the phone's capabilities.

capability
None

Parameters

TCaps & aCapsOn return, contains the phone capabilities.

GetInfo(TPhoneInfo &)

IMPORT_C TIntGetInfo(TPhoneInfo &aPhoneInfo)const

Gets a snapshot of the current phone information.

This function is expected to complete quickly. Consequently, an asynchronous variant has not been provided.

capability
None

Parameters

TPhoneInfo & aPhoneInfoOn return, contains the current phone information

GetLineInfo(const TInt, TLineInfo &)

IMPORT_C TIntGetLineInfo(const TIntaIndex,
TLineInfo &aLineInfo
)const

Returns a RPhone::TLineInfo containing information about a line. Select the line by passing RPhone::GetLineInfo() a number from zero to (number of lines-1). RPhone::EnumerateLines() returns the number of lines. A line's information is enough to differentiate it from the other lines associated with the phone.

Included in the line information is the line's name, RPhone::TLineInfo::iName. Pass this to RLine::Open() to open the line and hence to control the line's calls.

Typically, line zero is the phone's voice line. However, you should not presume this. Instead, RPhone::TLineInfo::iLineCapsFlags contains a flag that describes the type of line.

RPhone::EnumerateLines()
capability
None

Parameters

const TInt aIndexThe index of the line for which information is required.
TLineInfo & aLineInfoOn return, contains the line information.

GetStatus(TStatus &)

IMPORT_C TIntGetStatus(TStatus &aStatus)const

Gets information about the status of the phone.

capability
None

Parameters

TStatus & aStatusOn return, contains the current phone status.

Initialise()

IMPORT_C TIntInitialise()

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.

The phone hardware is usually automatically initialised before the first command is sent.

Functions which retrieve information about the modem should be used once this function has completed - such information may be incorrect before initialisation is complete.

capability
NetworkControl

InitialiseCancel()

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

NotifyCapsChange(TRequestStatus &, TCaps &)

IMPORT_C voidNotifyCapsChange(TRequestStatus &aStatus,
TCaps &aCaps
)

Provides notification of changes in phone capabilities.

capability
None

Parameters

TRequestStatus & aStatusA variable that indicates the completion status of the request.
TCaps & aCapsOn request completion, contains the phone capabilities.

NotifyCapsChangeCancel()

IMPORT_C voidNotifyCapsChangeCancel()const
Cancels a 'Capabilities change' notification request, placed using the NotifyCapsChange() function.
capability
None

NotifyModemDetected(TRequestStatus &, TModemDetection &)

IMPORT_C voidNotifyModemDetected(TRequestStatus &aStatus,
TModemDetection &aDetection
)

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

Clearly, this function has no use if the modem (DCE) is permanently attached to the computing device (DTE).

capability
None

Parameters

TRequestStatus & aStatusA flag that indicates the completion status of the request.
TModemDetection & aDetectionOn return, contains the new status.

NotifyModemDetectedCancel()

IMPORT_C voidNotifyModemDetectedCancel()const
Cancels an outstanding modem detection notification, placed using the NotifyModemDetected() function.
capability
None

Open(RTelServer &, const TDesC &)

IMPORT_C TIntOpen(RTelServer &aSession,
const TDesC &aName
)

Parameters

RTelServer & aSession
const TDesC & aName

SetEmergencyClient(const TUint32)

IMPORT_C TIntSetEmergencyClient(const TUint32aEmergencyRequest)const

This method allows the client to instruct the ETel server and the TSY to preallocate extra memory for any potential emergency request handling from this client. It allows other, non-priority, clients who operate under emergency conditions, to have memory preallocated for them in the ETel server. The request gets passed down to the TSY, so that the TSY can also proceed with the necessary memory pre-allocation. The client specifies the type of emergency requests that it wishes to handle in the aEmergencyRequest parameter. aEmergencyRequest is a bit-mask where each bit-flag represents the emergency request type that the client wishes to handle. See definition of TEmergencyRequest for the emergency request types bit-flag positions.

The memory required is calculated by the server and the TSY according to the aEmergencyRequest parameter. If the pre-allocation of memory within this method fails, the method returns KErrNoMemory. If the same emergency client calls this method multiple times, the ETel server will return the KErrAlreadyExists error. KErrAlreadyExists will also be returned if another RPhone client created using the same RTelServer session also calls this method.

Note that the ETel allocates emergency heap per client or more precisely per client's RTelServer session. The client is expected to use only one emergency sub-session of the same type at a time. If the client has a requirement to use multiple, concurrent subsessions that handle the same emergency functionality, then it needs to open separate RTelServer sessions, otherwise ETel might run out of the preallocated emergency memory.

If the API is called after the call to RTelServer::SetPriorityClient from the same session then the function returns KErrAlreadyExists.

TEmergencyRequest
capability
WriteDeviceData

Parameters

const TUint32 aEmergencyRequest

Member Enumerations Documentation

Enum TCapsFlags

Phone capability flags.

Enumerators

KCapsUnknown = 0x00000001

The capabilities of the phone are not known.

KCapsData = 0x00000002

The phone supports data calls.

KCapsFaxClassOne = 0x0000004

The phone supports the fax class 1 interface.

KCapsFaxClassOnePointZero = 0x0000008

The phone supports the fax class 1.0 interface.

KCapsFaxClassTwo = 0x00000010

The phone supports the fax class 2 interface.

KCapsFaxClassTwoPointZero = 0x00000020

The phone supports the fax class 2.0 interface.

KCapsFaxClassTwoPointOne = 0x00000040

The phone supports the fax class 2.1 interface.

KCapsVoice = 0x00000080

The phone supports voice calls.

KCapsEventModemDetection = 0x00010000

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

KCapsStealCommPort = 0x00020000

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

Enum TEmergencyRequest

Enumerators

EEmergencyLCSRequest = 0x00000001

Location Based Services Emergency Request

EEmergencyCSVoiceCallRequest = 0x00000002

Circuit Switch Voice Call Emergency Request

Enum TMode

Phone mode status flags.

Enumerators

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

Modem connection status flags.

Enumerators

EDetectedPresent

Modem present.

EDetectedNotPresent

Modem is not present.

EDetectedUnknown

Modem connection status is unknown.