summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/io_serial.h
authorwazlaf <wazlaf>2002-09-28 14:58:25 (UTC)
committer wazlaf <wazlaf>2002-09-28 14:58:25 (UTC)
commitea1975bdf411de3e08e7b84d2480a522596fe143 (patch) (unidiff)
tree3cd90b3440fa190e9853f66cbd1e9dfaeb6f330c /noncore/apps/opie-console/io_serial.h
parent93f90487bf9d2b8937a4933aef2ee472b5cdc89c (diff)
downloadopie-ea1975bdf411de3e08e7b84d2480a522596fe143.zip
opie-ea1975bdf411de3e08e7b84d2480a522596fe143.tar.gz
opie-ea1975bdf411de3e08e7b84d2480a522596fe143.tar.bz2
Some changes in io_layer.h; Untested Serial IOLayer implementation added
Diffstat (limited to 'noncore/apps/opie-console/io_serial.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_serial.h51
1 files changed, 49 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/io_serial.h b/noncore/apps/opie-console/io_serial.h
index c6a2efd..1d34411 100644
--- a/noncore/apps/opie-console/io_serial.h
+++ b/noncore/apps/opie-console/io_serial.h
@@ -1,16 +1,63 @@
1#ifndef OPIE_IO_SERIAL 1#ifndef OPIE_IO_SERIAL
2#define OPIE_IO_SERIAL 2#define OPIE_IO_SERIAL
3 3
4#include <qsocketnotifier.h>
4#include "io_layer.h" 5#include "io_layer.h"
5 6
7/* Default values to be used if the profile information is incomplete */
8#define SERIAL_DEFAULT_DEVICE "/dev/ttyS0"
9#define SERIAL_DEFAULT_BAUD 9600
10#define SERIAL_DEFAULT_PARITY 0
11#define SERIAL_DEFAULT_DBITS 8
12#define SERIAL_DEFAULT_SBITS 1
13#define SERIAL_DEFAULT_FLOW 0
14
15/* IOSerial implements a RS232 IO Layer */
16
6class IOSerial : public IOLayer { 17class IOSerial : public IOLayer {
7 Q_OBJECT 18 Q_OBJECT
8public: 19public:
20 enum Parity {
21 ParityNone = 0,
22 ParityEven,
23 ParityOdd,
24 ParitySpace,
25 ParityMark
26 };
27
28 enum Flow {
29 FlowHW = 0x01,
30 FlowSW = 0x02
31 };
32
9 IOSerial(const Config &); 33 IOSerial(const Config &);
10public slots: 34 ~IOSerial();
35
36 QString identifier() const;
37 QString name() const;
38signals:
11 void received(const QByteArray &); 39 void received(const QByteArray &);
12 void error(int, const QString &); 40 void error(int, const QString &);
41public slots:
42 void send(const QByteArray &);
43 bool open();
44 void close();
45 void reload(const Config &);
46protected:
47 int getBaud(int baud) const;
48protected slots:
49 void dataArrived();
50 void errorOccured();
51protected:
52 QSocketNotifier *m_read;
53 QSocketNotifier *m_error;
54 QString m_device;
55 int m_baud;
56 int m_parity;
57 int m_dbits;
58 int m_sbits;
59 int m_flow;
60 int m_fd;
13}; 61};
14 62
15
16#endif /* OPIE_IO_SERIAL */ 63#endif /* OPIE_IO_SERIAL */