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 void Close ()
IMPORT_C TInt EnumerateLines ( TInt &)
IMPORT_C TInt GetCaps ( TCaps &)
IMPORT_C TInt GetInfo ( TPhoneInfo &)
IMPORT_C TInt GetLineInfo (const TInt , TLineInfo &)
IMPORT_C TInt GetStatus ( TStatus &)
IMPORT_C TInt Initialise ()
IMPORT_C void InitialiseCancel ()
IMPORT_C void NotifyCapsChange ( TRequestStatus &, TCaps &)
IMPORT_C void NotifyCapsChangeCancel ()
IMPORT_C void NotifyModemDetected ( TRequestStatus &, TModemDetection &)
IMPORT_C void NotifyModemDetectedCancel ()
IMPORT_C TInt Open ( RTelServer &, const TDesC &)
IMPORT_C TInt SetEmergencyClient (const TUint32 )
Protected Member Functions
IMPORT_C void ConstructL ()
IMPORT_C void Destruct ()
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
enum TCapsFlags {
KCapsUnknown  = 0x00000001, KCapsData  = 0x00000002, KCapsFaxClassOne  = 0x0000004, KCapsFaxClassOnePointZero  = 0x0000008, KCapsFaxClassTwo  = 0x00000010, KCapsFaxClassTwoPointZero  = 0x00000020, KCapsFaxClassTwoPointOne  = 0x00000040, KCapsVoice  = 0x00000080, KCapsEventModemDetection  = 0x00010000, KCapsStealCommPort  = 0x00020000
}
enum TEmergencyRequest { EEmergencyLCSRequest  = 0x00000001, EEmergencyCSVoiceCallRequest  = 0x00000002 }
enum TMode { EModeUnknown , EModeIdle , EModeEstablishingLink , EModeOnlineData , EModeOnlineCommand }
enum TModemDetection { EDetectedPresent , EDetectedNotPresent , EDetectedUnknown }
Inherited Enumerations
RTelSubSessionBase:TReqPriorityType
Inherited Attributes
RTelSubSessionBase::iPtrHolder

Constructor & Destructor Documentation

RPhone()

IMPORT_C RPhone ( )

Empty default constructor.

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

Member Functions Documentation

Close()

IMPORT_C void Close ( )

ConstructL()

IMPORT_C void ConstructL ( ) [protected, virtual]
capability
None

Destruct()

IMPORT_C void Destruct ( ) [protected, virtual]
capability
None

EnumerateLines(TInt &)

IMPORT_C TInt EnumerateLines ( TInt & aCount ) const

Gets the number of lines associated with the phone.

RPhone::GetLineInfo()
capability
None

Parameters

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

GetCaps(TCaps &)

IMPORT_C TInt GetCaps ( TCaps & aCaps ) const

Gets the phone's capabilities.

capability
None

Parameters

TCaps & aCaps On return, contains the phone capabilities.

GetInfo(TPhoneInfo &)

IMPORT_C TInt GetInfo ( 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 & aPhoneInfo On return, contains the current phone information

GetLineInfo(const TInt, TLineInfo &)

IMPORT_C TInt GetLineInfo ( const TInt aIndex,
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.

Parameters

const TInt aIndex The index of the line for which information is required.
TLineInfo & aLineInfo On return, contains the line information.

GetStatus(TStatus &)

IMPORT_C TInt GetStatus ( TStatus & aStatus ) const

Gets information about the status of the phone.

capability
None

Parameters

TStatus & aStatus On return, contains the current phone status.

Initialise()

IMPORT_C TInt Initialise ( )

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 void InitialiseCancel ( )
Cancels a request to initialise the modem, placed using the asynchronous variant of the Initialise() function.
capability
NetworkControl

NotifyCapsChange(TRequestStatus &, TCaps &)

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

Provides notification of changes in phone capabilities.

capability
None

Parameters

TRequestStatus & aStatus A variable that indicates the completion status of the request.
TCaps & aCaps On request completion, contains the phone capabilities.

NotifyCapsChangeCancel()

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

NotifyModemDetected(TRequestStatus &, TModemDetection &)

IMPORT_C void NotifyModemDetected ( 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 & aStatus A flag that indicates the completion status of the request.
TModemDetection & aDetection On return, contains the new status.

NotifyModemDetectedCancel()

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

Open(RTelServer &, const TDesC &)

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

Parameters

RTelServer & aSession
const TDesC & aName

SetEmergencyClient(const TUint32)

IMPORT_C TInt SetEmergencyClient ( const TUint32 aEmergencyRequest ) 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.