kmobiletools
KMobileTools::SerialManager Class Reference
#include <serialdevice.h>

Detailed Description
This class can manage a QSerial object, initialize the modem, sending AT commands, parsing answers.Definition at line 40 of file serialdevice.h.
Public Slots | |
| void | gotData () |
| void | gotError (int) |
| void | log (bool incoming, const QString &data) |
Signals | |
| void | connected () |
| void | disconnected () |
| void | error () |
| void | invalidLockFile (const QString &) |
Public Member Functions | |
| void | close () |
| QString | devicePath () const |
| bool | isConnected () |
| void | lockMutex () |
| bool | open (KMobileTools::Job *job) |
| QSerial * | qserial () |
| QString | sendATCommand (KMobileTools::Job *job, const QString &cmd, uint timeout=MAX_TIMEOUT, bool tryBreakingTimeout=true) |
| SerialManager (QObject *parent, const QString &objname, const QString &devicePath=QString(), const QStringList &initStrings=QStringList()) | |
| void | setDevicePath (const QString &path) |
| void | setSpeed (int value) |
| void | unlockMutex () |
| ~SerialManager () | |
Static Public Member Functions | |
| static bool | ATError (const QString &buffer) |
| static QString | decodePDU (const QString &text) |
Constructor & Destructor Documentation
| SerialManager::SerialManager | ( | QObject * | parent, | |
| const QString & | objname, | |||
| const QString & | devicePath = QString(), |
|||
| const QStringList & | initStrings = QStringList() | |||
| ) |
Creates a new SerialManager object.
- Parameters:
-
parent the parent object. name the name of this object. devicePath path to use while initializing the serial device. initStrings AT commands to send to the serial port while initializing.
- Todo:
- this config entry has been removed, port or remove...
Definition at line 114 of file serialdevice.cpp.
| SerialManager::~SerialManager | ( | ) |
Member Function Documentation
| bool KMobileTools::SerialManager::ATError | ( | const QString & | buffer | ) | [static] |
Definition at line 475 of file serialdevice.cpp.
| void SerialManager::close | ( | ) |
| void KMobileTools::SerialManager::connected | ( | ) | [signal] |
Definition at line 461 of file serialdevice.cpp.
| QString SerialManager::devicePath | ( | ) | const |
Definition at line 233 of file serialdevice.cpp.
| void KMobileTools::SerialManager::disconnected | ( | ) | [signal] |
| void KMobileTools::SerialManager::error | ( | ) | [signal] |
| void SerialManager::gotData | ( | ) | [slot] |
Definition at line 391 of file serialdevice.cpp.
| void KMobileTools::SerialManager::gotError | ( | int | err | ) | [slot] |
Definition at line 485 of file serialdevice.cpp.
| void KMobileTools::SerialManager::invalidLockFile | ( | const QString & | ) | [signal] |
| bool SerialManager::isConnected | ( | ) |
Convenience method to see if the Serial object is connected to the device.
- Returns:
- true if the device is connected, false otherwise.
Definition at line 127 of file serialdevice.cpp.
| void SerialManager::lockMutex | ( | ) |
Definition at line 90 of file serialdevice.cpp.
| void KMobileTools::SerialManager::log | ( | bool | incoming, | |
| const QString & | data | |||
| ) | [slot] |
Definition at line 495 of file serialdevice.cpp.
| bool SerialManager::open | ( | KMobileTools::Job * | job | ) |
Opens the serial port for read/write commands.
- Returns:
- true if the port was opened, false otherwise.
Definition at line 147 of file serialdevice.cpp.
| KMobileTools::QSerial * SerialManager::qserial | ( | ) |
Returns the QSerial class managed by this object.
- Returns:
- the managed QSerial object if is valid, 0 otherwise.
Definition at line 386 of file serialdevice.cpp.
| QString SerialManager::sendATCommand | ( | KMobileTools::Job * | job, | |
| const QString & | cmd, | |||
| uint | timeout = MAX_TIMEOUT, |
|||
| bool | tryBreakingTimeout = true | |||
| ) |
Sends an AT command to the serial port.
- Parameters:
-
cmd the command to send. timeout wait for the answer until timeout expires. A value of 0 will loop forever. Timeout is in milliseconds.
- Returns:
- the answer to cmd, or QString() if an error occurred.
look if this can be valid for bluetooth socket too
- Todo:
- KMobileTools::EnginesList::instance()->closing() is obsolete
remove the size() check, if possible, since it slows down serial access.
look if this can be valid for bluetooth socket too
handle also partial errors
Definition at line 237 of file serialdevice.cpp.
| void SerialManager::setDevicePath | ( | const QString & | path | ) |
Change the device this class is pointing to.
- Parameters:
-
path the path to the device to manage.
Definition at line 134 of file serialdevice.cpp.
| void SerialManager::setSpeed | ( | int | value | ) |
have to move this somewhere.
.. better baudrate management
Definition at line 434 of file serialdevice.cpp.
| void SerialManager::unlockMutex | ( | ) |
Definition at line 94 of file serialdevice.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference