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() |
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 |
IMPORT_C | RPhone | ( | ) |
Empty default constructor.
Constructs an empty RPhone object, and is present only to support virtual function table export.
IMPORT_C TInt | EnumerateLines | ( | TInt & | aCount | ) | const |
Gets the number of lines associated with the phone.
TInt & aCount | On return, contains the number of lines associated with the phone. |
IMPORT_C TInt | GetCaps | ( | TCaps & | aCaps | ) | const |
Gets the phone's capabilities.
TCaps & aCaps | On return, contains the phone capabilities. |
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.
TPhoneInfo & aPhoneInfo | On return, contains the current phone information |
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.
IMPORT_C TInt | GetStatus | ( | TStatus & | aStatus | ) | const |
Gets information about the status of the phone.
TStatus & aStatus | On return, contains the current phone status. |
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.
IMPORT_C void | InitialiseCancel | ( | ) |
IMPORT_C void | NotifyCapsChange | ( | TRequestStatus & | aStatus, |
TCaps & | aCaps | |||
) |
Provides notification of changes in phone capabilities.
TRequestStatus & aStatus | A variable that indicates the completion status of the request. |
TCaps & aCaps | On request completion, contains the phone capabilities. |
IMPORT_C void | NotifyCapsChangeCancel | ( | ) | const |
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).
TRequestStatus & aStatus | A flag that indicates the completion status of the request. |
TModemDetection & aDetection | On return, contains the new status. |
IMPORT_C void | NotifyModemDetectedCancel | ( | ) | const |
IMPORT_C TInt | Open | ( | RTelServer & | aSession, |
const TDesC & | aName | |||
) |
RTelServer & aSession | |
const TDesC & aName |
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.
const TUint32 aEmergencyRequest |
Phone capability flags.
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. |
EEmergencyLCSRequest = 0x00000001 |
Location Based Services Emergency Request |
EEmergencyCSVoiceCallRequest = 0x00000002 |
Circuit Switch Voice Call Emergency Request |
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. |
Modem connection status flags.
EDetectedPresent |
Modem present. |
EDetectedNotPresent |
Modem is not present. |
EDetectedUnknown |
Modem connection status is unknown. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.