Home · All Classes · Annotated · Functions

QPhoneVendorAt Class Reference

The QPhoneVendorAt class encapsulates vendor-specific GSM modem functionality More...

#include <QPhoneVendorAt>

Inherits QObject.

Public Functions

Static Public Members

Protected Functions

Additional Inherited Members


Detailed Description

The QPhoneVendorAt class encapsulates vendor-specific GSM modem functionality

Vendors can subclass QPhoneVendorAt to provide vendor-specific functionality that isn't part of the base GSM 07.07 and GSM 07.05 specifications that the qtopiaphone library supports.

There can be multiple vendor objects active in the system, each one supporting a different type of modem. During startup, the vendor objects enter a detection phase to determine which one actually applies.

Thus, a system integrator can build a single binary version of Qtopia that will work with several different modem types. Or the system integrator can disable all vendor objects except the precise one that it is interested in.

The method "createVendors()" in this class is called by the phone library to create the initial vendor object list. If you add a new vendor handling subclass, you will need to modify this method.

See also QPhoneLine.


Member Function Documentation

QPhoneVendorAt::QPhoneVendorAt ( QPhoneLineAt * parent, const char * name = 0 )

Construct a vendor object attached to parent called name.

QPhoneVendorAt::~QPhoneVendorAt ()   [virtual]

Destruct this phone vendor object.

void QPhoneVendorAt::abortDial ( uint modemIdentifier, QPhoneCall::Scope scope )   [virtual]

Abort a ATD dial command for the call modemIdentifier. The scope parameter is passed from QModemCall::hangup().

The default implementation calls abortDialCommand() followed by either ATH or AT+CHLD=1n depending upon the return value of needsAthForAbort().

void QPhoneVendorAt::abortDialCommand ()   [protected]

Abort the current ATD command by sending a carriage return.

void QPhoneVendorAt::callNotification ( QPhoneCall call, QPhoneCall::Notification type, const QString & value )   [protected]

Emit a notification signal on a particular phone call object to notify client applications of a change in the auxillary value associated with type.

void QPhoneVendorAt::callStatusAvailable ()   [protected]

The initialization process should invoke "callStatusAvailable()" if the modem supports unsolicited call status indications.

The most important indications are those that indicate remote hangup and the transition from "dialing" to "connected".

void QPhoneVendorAt::changeState ( QPhoneCall call, QPhoneCall::State state )   [protected]

Change the state on a call object and emit the necessary signals.

void QPhoneVendorAt::chat ( const QString & cmd )   [protected]

Send an AT command, cmd, to the modem.

void QPhoneVendorAt::chat ( const QString & cmd, const char * slot )   [protected]

This is an overloaded member function, provided for convenience.

Send an AT command, cmd, to the modem and receive the response via slot.

void QPhoneVendorAt::chatLP ( const QString & cmd )   [protected]

Send an AT command, cmd, to the modem over the "low priority" channel. This channel is intended for long-running commands that might otherwise interfere with the smooth operation of regular commands.

void QPhoneVendorAt::chatLP ( const QString & cmd, const char * slot )   [protected]

This is an overloaded member function, provided for convenience.

Send an AT command, cmd, to the modem over the "low priority" channel and receive the response via slot.

void QPhoneVendorAt::clearRing ()   [protected]

Clear the ringing state in the phone library. This should be invoked if the modem detects a missed call.

void QPhoneVendorAt::createVendors ( QList<QPhoneVendorAt *> & vendors, QPhoneLineAt * parent )   [static]

Create the initial list of vendor control objects for the phone line parent and append it to vendors. This function will need to be modified if you add a new vendor control class.

QSimCommand QPhoneVendorAt::decodeSimCommand ( const QByteArray & binary )   [protected]

Decode a SIM command from its raw binary form, as according to GSM 11.14. The binary data is assumed to be in BER form, starting with the command tag. If the data starts with a "Proactive SIM" BER command wrapper, it will be skipped.

void QPhoneVendorAt::detect ( const QString & manufacturer )   [virtual]

Detect whether the modem can be handled by this vendor object.

The manufacturer argument is a copy of the response from "AT+CGMI", which may allow this method to quickly determine if this vendor object supports the modem.

If the vendor modem is detected, the object will typically call "registerNotificationType" to register the notifications that it is interested in seeing via the "notification" slot, and call "callStatusAvailable()" to indicate if dynamic call status monitoring is possible.

Finally, if this vendor object determines that it does indeed support the modem, it should call "setEnabled(true)". Otherwise, it should call "setEnabled(false)".

void QPhoneVendorAt::emitNotification ( QPhoneLine::QueryType type, const QString & value ) const   [protected]

Emit a "notification" signal on the QPhoneLine object for type and value.

void QPhoneVendorAt::emitQueryResult ( QPhoneLine::QueryType type, const QString & value ) const   [protected]

Emit a "queryResult" signal on the QPhoneLine object for type and value.

bool QPhoneVendorAt::emptyPinIsReady () const   [virtual]

On some modems, an empty response to "AT+CPIN?" is the same as a "READY" response. This function returns true to indicate such behavior. The default is false.

bool QPhoneVendorAt::enabled () const

Determine if this vendor is currently enabled. Disabled vendors are ignored when accessing vendor-specific functionality.

See also setEnabled().

QByteArray QPhoneVendorAt::encodeSimEnvelope ( QSimToolkitPrivate::ResponseType type, const QString & data1, uint data2, QSimCommand::Type data3 )   [protected]

Encode a SIM "ENVELOPE" into its raw binary form, as according to GSM 11.14. The binary data will be in BER form, starting with the envelope type tag. This is only useful to encode responses to "SET UP MENU". The envelope parameters are type, data1, data2, and data3.

QByteArray QPhoneVendorAt::encodeSimResponse ( QSimToolkitPrivate::ResponseType type, const QString & data1, uint data2, QSimCommand::Type data3, const QByteArray & command )   [protected]

Encode a SIM "TERMINAL RESPONSE" into its raw binary form, as according to GSM 11.14. The binary data will be in BER form, starting with the command tag. The command parameter should contain the bytes that made up the command that this response pertains to. The response parameters are type, data1, data2, and data3.

QPhoneCall QPhoneVendorAt::findByIdentifier ( uint identifier )   [protected]

Find a particular phone call object given its call identifier. Modems typically allocate small numbers like 1, 2, or 3 to active calls. This function allows the vendor object to retrieve the correct object when it receives a notification for a specific call.

void QPhoneVendorAt::flushCaches ()   [protected]

Flush all cached phone book or SMS information from the system because the SIM has been removed from the modem.

QByteArray QPhoneVendorAt::fromHex ( const QString & hex )   [static]

Convert a hexadecimal string, hex, into a byte array.

void QPhoneVendorAt::hangupRemote ( QPhoneCall call )   [protected]

Indicate to the phone library that the specified call has been hung up remotely. This will typically be sent in response to a call status notification message from the modem.

bool QPhoneVendorAt::hasCellBroadcast () const   [virtual]

Returns true if the modem has cell broadcast message support (i.e. support for the AT+CSCB command).

bool QPhoneVendorAt::hasDelayedRegistration () const   [virtual]

Returns true if network registration commands such as AT+CREG and AT+COPS need to be delayed until later in the initialisation sequence. The vendor-specific class is responsible for deciding when "later" occur and issuing the commands then.

bool QPhoneVendorAt::hasDelayedSMSStartup () const   [virtual]

Determine if access to SMS facilities will be delayed by the modem until it has properly initialized itself. Some modems will refuse to respond to SMS commands until internal initialization is complete. The vendor object can indicate that the SMS facilities are initialized by calling "smsReady()".

bool QPhoneVendorAt::hasEmptyPhoneBookIndex () const   [virtual]

Returns true if the "index" option to the AT+CPBW command should be empty to add an element rather than to update an existing element. Returns false (the default) if the "index" option should be "0" for this case.

bool QPhoneVendorAt::hasModemPhoneBookCache () const   [virtual]

Determine if the modem has an internal phone book cache. If this function returns true, then the phone library will not attempt to access phone books until "phoneBooksReady()" has been called.

bool QPhoneVendorAt::hasRepeatingRings () const   [virtual]

Returns true if the modem automatically resends RING every few seconds while a call is incoming, and stops sending RING if the caller hangs up. Returns false if the modem does not resend RING every few seconds and instead uses some other mechanism to notify Qtopia that a remote hangup has occurred.

bool QPhoneVendorAt::hasSingleMessageStore () const   [virtual]

Determine if the modem has only a single message store called "SM". Normally, both "SM" and "ME" are inspected for incoming messages.

bool QPhoneVendorAt::hasUnsolicited ( QPhoneLine::QueryType type ) const   [virtual]

Determine if this vendor supports a particular type of unsolicited notification (e.g. SignalQuality, BatteryCharge) which will negate the need to poll for the value.

QPhoneCall QPhoneVendorAt::incomingCall ()   [protected]

Get the call identifier for the current incoming call.

void QPhoneVendorAt::init ()   [virtual]

Initialize modem-specific functionality. This is called on the single vendor object which was detected by "detect()".

This function may be called more than once, especially after the modem has been reset using the "AT+CFUN" command. The "detect()" function will only be called once.

QPhoneLineAt * QPhoneVendorAt::line () const

Return the line associated with this vendor object.

QString QPhoneVendorAt::messageListCommand () const   [virtual]

Return the command that lists the contents of an SMS message store. Normally this is "AT+CMGL=4", but some modems do not like the "=4".

bool QPhoneVendorAt::modifyFilter ( QPhoneLine::QueryType type, const QString & value )   [virtual]

Filter modification requests for setting type to value. If this vendor object needs special handling for type, it should perform its own vendor-specific functionality and return true. Otherwise, it should return FALSe to let the regular handling proceed.

QStringList QPhoneVendorAt::modifyGPRSInit ( const QStringList & cmds ) const   [virtual]

Modify the list of AT commands to use for GPRS initialization, inserting or removing commands as required. Typically, the incoming cmds list will contain AT+CGDCONT, AT+CGQREQ, AT+CGqMin, AT+CGATT, AT+CGACT, and ATD commands.

bool QPhoneVendorAt::needsAthForAbort () const   [virtual]

Determine if the modem needs to use ATH to abort a dial request instead of the more usual AT+CHLD=1.

bool QPhoneVendorAt::needsAthForBusy () const   [virtual]

Determine if the modem needs to use ATH to reject an incoming call because the user is busy, instead of the more usual AT+CHLD=0. The default implementation returns false.

bool QPhoneVendorAt::partOfHoldGroup ( QPhoneCall::CallType type ) const   [virtual]

Determine if a particular kind of call is part of the normal hold group. On some systems, video calls are separate from the call grouping for voice and fax calls. Returns true by default. The type parameter indicates the type of call (phone, video, fax, etc).

void QPhoneVendorAt::phoneBooksReady ()   [protected]

Indicate that the modem is now ready to accept phone book related commands. See the description of "hasModemPhoneBookCache()" for more information.

bool QPhoneVendorAt::queryFilter ( QPhoneLine::QueryType type )   [virtual]

Filter query requests for type. If this vendor object needs special handling for type, it should perform its own vendor-specific functionality and return true. Otherwise, it should return false to let the regular handling proceed.

void QPhoneVendorAt::registerNotificationType ( const QString & type, QObject * target, const char * slot, bool mayBeCommand = false )   [protected]

Register a notification type with the AT command subsystem. Messages that start with type are sent to the vendor object via the "notification" slot.

If mayBeCommand is true, then the notification type may also be a valid command response, so the AT command subsystem must take care to properly distinguish command responses from notifications.

The notification will be delivered to slot on target.

QPhoneCall::CallType QPhoneVendorAt::resolveCallType ( const QString & type ) const   [virtual]

Resolve a call type on a "+CRING" notification into the particular type of call that it represents. The type is guaranteed to be in lower case on entry to this function.

void QPhoneVendorAt::ring ( const QString & number, QPhoneCall::CallType t = QPhoneCall::Voice )   [protected]

Set the ringing state in the phone library, indicating a call from number of the type t.

Note: the phone library already handles the "RING" and "+CRING" notifications. This method is for other modem-specific notifications.

void QPhoneVendorAt::send ( const QString & cmd )   [protected]

Send an AT command, cmd, to the modem immediately, without waiting for existing commands to complete. This is typically used to send ATH to the modem to abort a ATD command.

void QPhoneVendorAt::setEnabled ( bool flag )

Set the enable flag on this vendor object. Disabled vendors are ignored when accessing vendor-specific functionality.

Initially, all vendor objects will be enabled, but after detection, only one should remain enabled.

See also enabled().

bool QPhoneVendorAt::shouldLeaveMessageStoreAlone () const   [virtual]

Determine if the phone library should leave the message store alone when accessing SMS messages rather than force it to "SM".

void QPhoneVendorAt::simBegin ()   [virtual]

Begin SIM toolkit functionality. This is called whenever the user activates the SIM toolkit application within the phone's user interface. The vendor object will typically respond with either a call to "simBeginFailed()" or a call to "simCommand()" with the main menu on the SIM.

void QPhoneVendorAt::simBeginFailed ()   [protected]

Indicate that a call to "simBegin()" failed because SIM toolkit functionality is not available.

void QPhoneVendorAt::simCommand ( const QSimCommand & command )   [protected]

Process a command that came from a SIM toolkit application.

void QPhoneVendorAt::simEnd ()   [virtual]

End SIM toolkit functionality.

void QPhoneVendorAt::simInitializationDone ()   [protected]

Indicate that SIM toolkit initialization has finished.

void QPhoneVendorAt::simInitialize ()   [virtual]

Initialize the SIM toolkit functionality. Once initialization is complete, the vendor object must call "simInitializationDone()".

void QPhoneVendorAt::simResponse ( QSimToolkitPrivate::ResponseType type, const QString & data1, uint data2, QSimCommand::Type data3 )   [virtual]

Send a response to the SIM toolkit application. The response parameters are type, data1, data2, and data3.

void QPhoneVendorAt::smsReady ()   [protected]

Indicate that the SMS facilities are ready. See the description of "hasDelayedSMSStartup()" for more information.

QString QPhoneVendorAt::toHex ( const QByteArray & binary )   [static]

Convert the byte array binary into a hexadecimal string.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7