00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __WVMODEM_H
00014 #define __WVMODEM_H
00015
00016 #include "wvlockdev.h"
00017 #include "wvfile.h"
00018 #include "wvlog.h"
00019 #include <termios.h>
00020
00021 #ifndef IUCLC
00022 #define IUCLC 0
00023 #endif
00024
00025 #ifndef OLCUC
00026 #define OLCUC 0
00027 #endif
00028
00029 #ifndef XCASE
00030 #define XCASE 0
00031 #endif
00032
00039 class WvModemBase : public WvFile
00040 {
00041 protected:
00042 struct termios t;
00043 int baud;
00044
00045 WvModemBase() { }
00046
00047 int get_real_speed();
00048
00049 public:
00050 bool die_fast;
00051
00052 WvModemBase(int _fd);
00053 virtual ~WvModemBase();
00054
00056 virtual void close();
00057
00059 virtual bool carrier();
00060
00062 virtual int speed(int _baud);
00063
00065 int getspeed()
00066 { return baud; }
00067
00069 virtual void hangup();
00070 };
00071
00072
00077 class WvModem : public WvModemBase
00078 {
00079 private:
00080 WvLockDev lock;
00081 WvLog log;
00082 struct termios old_t;
00083 bool closing;
00084 bool no_reset;
00085
00090 void setup_modem(bool rtscts);
00091
00093 int getstatus();
00094
00095 public:
00096 WvModem(WvStringParm filename, int _baud, bool rtscts = true,
00097 bool _no_reset = false);
00098 virtual ~WvModem();
00099
00101 virtual void close();
00102
00104 virtual bool carrier();
00105
00110 virtual int speed(int _baud);
00111 };
00112
00113 #endif