Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QModemService class implements telephony functionality for AT-based modems. More...
#include <QModemService>
Inherits QTelephonyService.
The QModemService class implements telephony functionality for AT-based modems.
The default implementation uses AT commands from the GSM standards 3GPP TS 07.07, 3GPP TS 07.05, 3GPP TS 27.007, and 3GPP TS 27.005.
The implementation can be customized for proprietary modem command sets by inheriting QModemService and overriding QModemService::initialize(), which should create new interfaces to replace the default implementations.
For example, consider a modem that uses different commands for network registration than the GSM standard specifies. The modem integrator would create a new modem service class that overrides the default implementation of network registration:
class MyModemService : public QModemService { ... void initialize(); ... }; void MyModemService::initialize() { if ( !supports<QNetworkRegistration>() ) addInterface( new MyNetworkRegistration(this) ); QModemService::initialize(); }
The new functionality can then be implemented in the MyNetworkRegistration class, which will inherit from QNetworkRegistrationServer. The MyModemService::initialize() method first calls supports() to check if an instance of QNetworkRegistration has already been added.
This modem service handles the following posted events, via QModemService::post():
See also QTelephonyService.
Creates a new modem service handler called service and attaches it to parent.
The device parameter specifies the serial device and baud rate to use to communicate with the modem (for example, /dev/ttyS0:115200).
If device is empty, the default serial device specified by the QTOPIA_PHONE_DEVICE environment variable is used.
Creates a new modem service handler called service and attaches it to parent. The mux parameter specifies the serial device multiplexer to use for accessing the modem.
This version of the constructor may be needed if the modem is accessed via some mechanism other than kernel-level serial devices. The caller would construct an appropriate multiplexer wrapper around the new mechanism before calling this constructor.
Destroys this modem service and all of its interfaces.
Sends command to the modem on the primary AT chat channel. If the command fails, the caller will not be notified.
See also primaryAtChat() and retryChat().
This is an overloaded member function, provided for convenience.
Sends command to the modem on the primary AT chat channel. When the command finishes, notify slot on target. The slot has the signature done(bool,QAtResult&). The boolean parameter indicates if the command succeeded or not, and the QAtResult parameter contains the full result data.
The optional data parameter can be used to pass extra user data that will be made available to the target slot in the QAtResult::userData() field.
See also primaryAtChat() and retryChat().
Connects slot on target to receive posted item values. This can be used as an alternative to the posted() signal. Only those posted items that equal item will be delivered to the slot.
Creates and returns a vendor-specific modem service handler called service (the default is modem) and attaches it to parent.
The device parameter specifies the serial device and baud rate to use to communicate with the modem (for example, /dev/ttyS0:115200).
If device is empty, the default serial device specified by the QTOPIA_PHONE_DEVICE environment variable is used.
This function will load vendor-specific plug-ins to handle extended modem functionality as required. If the QTOPIA_PHONE_VENDOR environment variable is set, then that vendor plug-in will be loaded. Otherwise this function will issue the AT+CGMI command and ask each vendor plug-in if it supports the returned manufacturer value.
See also QModemServicePlugin.
Returns the modem indicator object for this modem service.
See also QModemIndicators.
Returns the serial device multiplexer that is being used to communicate with the modem.
Requests the SMS service from the modem and places it into PDU mode. The "smsready" item will be posted when it is ready. If the SMS service is already known to be ready and in PDU mode, then the "smsready" item will be posted upon the next entry to the event loop. The object requesting SMS service should use connectToPost() to monitor for when "smsready" is posted.
This implementation repeatedly sends AT+CMGF=0 every second for fifteen seconds until the command succeeds or the retry count expires. Higher levels that call this function should timeout their requests after fifteen seconds if "smsready" has not been received in the meantime.
See also post() and connectToPost().
Posts item to functionality providers that have expressed an interest via connectToPost() or posted(). The posted item will be delivered upon the next entry to the event loop.
Posted events are used as a simple communication mechanism between functionality providers. Providers that post items are completely decoupled from providers that consume items.
For example, posting the item sms:needed will ask the SMS functionality provider to initialize the SMS subsystem. Once SMS has been initialized, it will post the sms:available item. Other providers that depend upon SMS initialization can then proceed with using the SMS functionality.
See also connectToPost() and posted().
Signal that is emitted whenever an item is posted using post(). Slots that are connected to this signal should filter on item to determine if the posted item is relevant to them. Alternatively, they can use connectToPost() to only receive notification of specific posted items.
See also post() and connectToPost().
Returns the AT chat handler for the primary modem control channel.
See also secondaryAtChat().
Signal that is emitted when the modem has reset, either during start up or just after a AT+CFUN command. Slots that connect to this signal should issue AT commands to put the modem into a known state and to enable unsolicited notifications of interest to the connected object.
Retry command up to 15 times, once per second, until it succeeds. This is typically used to send initialization commands that may need several tries before the modem will accept them during start up.
See also primaryAtChat() and chat().
Returns the AT chat handler for the secondary modem control channel. This will return the same as primaryAtChat() if the modem does not have a secondary modem control channel.
See also primaryAtChat().
Processes a request to suspend modem operations and to put the modem into a low-power state. The modem vendor plug-in must call suspendDone() once the operation completes. The default implementation calls suspendDone().
This is intended for modems that need a special AT command or device ioctl operation to suspend the modem. If the modem does not need any special help, this function can be ignored.
This function is called in response to a suspend() command on the QCop channel QPE/ModemSuspend.
See also wake() and suspendDone().
Notifies the system that a suspend() operation has completed. The suspendDone() message is sent on the QCop channel QPE/ModemSuspend.
See also suspend() and wake().
Processes a request to wake up the modem from a suspend() state. The modem vendor plug-in must call wakeDone() once the operation completes. The default implementation calls wakeDone().
This function is called in response to a wake() command on the QCop channel QPE/ModemSuspend.
See also wakeDone() and suspend().
Notifies the system that a wake() operation has completed. The wakeDone() message is sent on the QCop channel QPE/ModemSuspend.
See also wake() and suspend().
Copyright © 2009 Nokia | Trademarks | Qt Extended 4.4.3 |