• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kmobiletools

KMobileTools::SerialManager

KMobileTools::SerialManager Class Reference

#include <serialdevice.h>

Inheritance diagram for KMobileTools::SerialManager:

Inheritance graph
[legend]

List of all members.


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 (  ) 

Destroys a SerialManager object.

Definition at line 128 of file serialdevice.cpp.


Member Function Documentation

bool KMobileTools::SerialManager::ATError ( const QString &  buffer  )  [static]

Definition at line 475 of file serialdevice.cpp.

void SerialManager::close (  ) 

Close the serial device, freeing resources.

Definition at line 218 of file serialdevice.cpp.

void KMobileTools::SerialManager::connected (  )  [signal]

QString SerialManager::decodePDU ( const QString &  text  )  [static]

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:
  • serialdevice.h
  • serialdevice.cpp

kmobiletools

Skip menu "kmobiletools"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal