From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/protocols/sms/services/kopete_unix_serial.h | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 kopete/protocols/sms/services/kopete_unix_serial.h (limited to 'kopete/protocols/sms/services/kopete_unix_serial.h') diff --git a/kopete/protocols/sms/services/kopete_unix_serial.h b/kopete/protocols/sms/services/kopete_unix_serial.h new file mode 100644 index 00000000..0248556b --- /dev/null +++ b/kopete/protocols/sms/services/kopete_unix_serial.h @@ -0,0 +1,70 @@ +// ************************************************************************* +// * Taken from the GSM TA/ME library +// * +// * File: gsm_unix_port.h +// * +// * Purpose: UNIX serial port implementation with extras +// * +// * Original Author: Peter Hofmann (software@pxh.de) +// * Modified by: Justin Huff (jjhuff@mspin.net) +// * +// * Created: 4.5.1999 +// ************************************************************************* + +#ifndef GSM_UNIX_SERIAL_KOPETE_H +#define GSM_UNIX_SERIAL_KOPETE_H + +#include "config.h" +#ifdef INCLUDE_SMSGSM + +#include +#include +#include +#include +#include +#include + +#include + +class QSocketNotifier; +namespace gsmlib +{ + +class KopeteUnixSerialPort : public QObject, public Port +{ + Q_OBJECT; + +protected: + int _fd; // file descriptor for device + int _oldChar; // character set by putBack() (-1 == none) + long int _timeoutVal; // timeout for getLine/readByte + + QSocketNotifier* _readNotifier; + + // throw GsmException include UNIX errno + void throwModemException(std::string message) throw(GsmException); + +public: + // create Port given the UNIX device name + KopeteUnixSerialPort(std::string device, speed_t lineSpeed = DEFAULT_BAUD_RATE, + std::string initString = DEFAULT_INIT_STRING, + bool swHandshake = false) + throw(GsmException); + virtual ~KopeteUnixSerialPort(); + + // inherited from Port + void putBack(unsigned char c); + int readByte() throw(GsmException); + std::string getLine() throw(GsmException); + void putLine(std::string line, + bool carriageReturn = true) throw(GsmException); + bool wait(GsmTime timeout) throw(GsmException); + void setTimeOut(unsigned int timeout); + +signals: + void activated(); +}; + +} +#endif +#endif // GSM_UNIX_SERIAL_KOPETE_H -- cgit v1.2.1