PhoneVendorAt Class Reference
Encapsulate vendor-specific GSM modem functionality.
More...
#include <phonevendor_p.h>
Inherits QObject.
List of all member functions.
Public Members
Static Public Members
- void createVendors ( QList<PhoneVendorAt> & vendors, PhoneLineAt * parent )
- QString toHex ( const QByteArray & binary )
- QByteArray fromHex ( const QString & hex )
Protected Members
- void chat ( const QString & cmd )
- void chat ( const QString & cmd, const char * slot )
- void chatLP ( const QString & cmd )
- void chatLP ( const QString & cmd, const char * slot )
- void registerNotificationType ( const QString & type, bool mayBeCommand = FALSE )
- PhoneCall findByIdentifier ( uint identifier )
- PhoneCall incomingCall ()
- void callStatusAvailable ()
- void ring ( const QString & number, PhoneCall::CallType t = PhoneCall::Voice )
- void clearRing ()
- void hangupRemote ( PhoneCall call )
- void changeState ( PhoneCall call, PhoneCall::State state )
- void callNotification ( PhoneCall call, PhoneCall::Notification type, const QString & value )
- void flushCaches ()
- void smsReady ()
- void phoneBooksReady ()
- void simInitializationDone ()
- void simBeginFailed ()
- void simCommand ( const SimCommand & command )
- void emitQueryResult ( PhoneLine::QueryType type, const QString & value ) const
- void emitNotification ( PhoneLine::QueryType type, const QString & value ) const
- SimCommand decodeSimCommand ( const QByteArray & binary )
- QByteArray encodeSimResponse ( SimToolkitPrivate::ResponseType type, const QString & data1, uint data2, SimCommand::Type data3, const QByteArray & command )
- QByteArray encodeSimEnvelope ( SimToolkitPrivate::ResponseType type, const QString & data1, uint data2, SimCommand::Type data3 )
Protected Slots
Detailed Description
Encapsulate vendor-specific GSM modem functionality
Vendors can subclass PhoneVendorAt 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 PhoneLine and Qtopia Phone Classes.
Member Function Documentation
PhoneVendorAt::PhoneVendorAt ( PhoneLineAt * parent, const char * name = 0 )
Construct a vendor object.
void PhoneVendorAt::callNotification ( PhoneCall call, PhoneCall::Notification type, const QString & value ) [protected]
Emit a notification signal on a particular phone call object to
notify client applications of a change in an auxillary value.
void PhoneVendorAt::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 PhoneVendorAt::changeState ( PhoneCall call, PhoneCall::State state ) [protected]
Change the state on a call object and emit the necessary signals.
void PhoneVendorAt::chat ( const QString & cmd ) [protected]
Send an AT command to the modem.
void PhoneVendorAt::chat ( const QString & cmd, const char * slot ) [protected]
Send an AT command to the modem and receive the response via slot.
void PhoneVendorAt::chatLP ( const QString & cmd ) [protected]
Send an AT command 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 PhoneVendorAt::chatLP ( const QString & cmd, const char * slot ) [protected]
Send an AT command to the modem over the "low priority" channel
and receive the response via slot.
void PhoneVendorAt::clearRing () [protected]
Clear the ringing state in the phone library. This should be
invoked if the modem detects a missed call.
void PhoneVendorAt::createVendors ( QList<PhoneVendorAt> & vendors, PhoneLineAt * parent ) [static]
Create the initial list of vendor control objects. This function
will need to be modified if you add a new vendor control class.
SimCommand PhoneVendorAt::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 PhoneVendorAt::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)".
bool PhoneVendorAt::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.
QByteArray PhoneVendorAt::encodeSimEnvelope ( SimToolkitPrivate::ResponseType type, const QString & data1, uint data2, SimCommand::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".
QByteArray PhoneVendorAt::encodeSimResponse ( SimToolkitPrivate::ResponseType type, const QString & data1, uint data2, SimCommand::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.
PhoneCall PhoneVendorAt::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 PhoneVendorAt::flushCaches () [protected]
Flush all cached phone book or SMS information from the system
because the SIM has been removed from the modem.
QByteArray PhoneVendorAt::fromHex ( const QString & hex ) [static]
Convert a hexadecimal string into a byte array.
void PhoneVendorAt::hangupRemote ( PhoneCall 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 PhoneVendorAt::hasCellBroadcast () const [virtual]
Returns TRUE if the modem has cell broadcast message support
(i.e. support for the AT+CSCB command).
bool PhoneVendorAt::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 PhoneVendorAt::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 PhoneVendorAt::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 PhoneVendorAt::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 PhoneVendorAt::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 PhoneVendorAt::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 PhoneVendorAt::hasUnsolicited ( PhoneLine::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.
PhoneCall PhoneVendorAt::incomingCall () [protected]
Get the call identifier for the current incoming call.
void PhoneVendorAt::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.
QString PhoneVendorAt::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 PhoneVendorAt::modifyFilter ( PhoneLine::QueryType type, const QString & value ) [virtual]
Filter modification 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.
QStringList PhoneVendorAt::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 PhoneVendorAt::needsAthForAbort () const [virtual]
Determine if the modem needs to use ATH to abort a dial request
instead of the more usual AT+CHLD=1.
void PhoneVendorAt::notification ( const QString & msg ) [virtual protected slot]
Slot that receives notification messages from the modem.
bool PhoneVendorAt::partOfHoldGroup ( PhoneCall::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.
void PhoneVendorAt::phoneBooksReady () [protected]
Indicate that the modem is now ready to accept phone book
related commands. See the description of "hasModemPhoneBookCache()"
for more information.
bool PhoneVendorAt::queryFilter ( PhoneLine::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 PhoneVendorAt::registerNotificationType ( const QString & type, 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.
PhoneCall::CallType PhoneVendorAt::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 PhoneVendorAt::ring ( const QString & number, PhoneCall::CallType t = PhoneCall::Voice ) [protected]
Set the ringing state in the phone library, indicating a call
from number.
Note: the phone library already handles the "RING" and "+CRING"
notifications. This method is for other modem-specific notifications.
void PhoneVendorAt::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.
bool PhoneVendorAt::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 PhoneVendorAt::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 PhoneVendorAt::simBeginFailed () [protected]
Indicate that a call to "simBegin()" failed because SIM toolkit
functionality is not available.
void PhoneVendorAt::simCommand ( const SimCommand & command ) [protected]
Process a command that came from a SIM toolkit application.
void PhoneVendorAt::simEnd () [virtual]
End SIM toolkit functionality.
void PhoneVendorAt::simInitializationDone () [protected]
Indicate that SIM toolkit initialization has finished.
void PhoneVendorAt::simInitialize () [virtual]
Initialize the SIM toolkit functionality. Once initialization is
complete, the vendor object must call "simInitializationDone()".
void PhoneVendorAt::simResponse ( SimToolkitPrivate::ResponseType type, const QString & data1, uint data2, SimCommand::Type data3 ) [virtual]
Send a response to the SIM toolkit application.
void PhoneVendorAt::smsReady () [protected]
Indicate that the SMS facilities are ready. See the description
of "hasDelayedSMSStartup()" for more information.
QString PhoneVendorAt::toHex ( const QByteArray & binary ) [static]
Convert a byte array into a hexadecimal string.
This file is part of the Qtopia platform,
copyright © 1995-2005
Trolltech, all rights reserved.
| Copyright © 2005 Trolltech
| Trademarks
| Qtopia version 2.2.0
|