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 <termios.h>
00019
00020
#ifndef IUCLC
00021 #define IUCLC 0
00022
#endif
00023
00024
#ifndef OLCUC
00025 #define OLCUC 0
00026
#endif
00027
00028
#ifndef XCASE
00029 #define XCASE 0
00030
#endif
00031
00032
00033
00034
00035
00036
00037
00038 class WvModemBase :
public WvFile
00039 {
00040
protected:
00041 struct termios t;
00042 int baud;
00043
00044 WvModemBase() { }
00045
00046
int get_real_speed();
00047
00048
public:
00049 bool die_fast;
00050
00051
WvModemBase(
int _fd);
00052
virtual ~WvModemBase();
00053
00054
00055
virtual void close();
00056
00057
00058
virtual bool carrier();
00059
00060
00061
virtual int speed(
int _baud);
00062
00063
00064 int getspeed()
00065 {
return baud; }
00066
00067
00068
virtual void hangup();
00069 };
00070
00071
00072
00073
00074
00075
00076 class WvModem :
public WvModemBase
00077 {
00078
private:
00079
WvLockDev lock;
00080
struct termios old_t;
00081
bool closing;
00082
00083
00084
00085
00086
00087
void setup_modem(
bool rtscts );
00088
00089
00090
int getstatus();
00091
00092
public:
00093
WvModem(
const char * filename,
int _baud,
bool rtscts =
true );
00094
virtual ~WvModem();
00095
00096
00097
virtual void close();
00098
00099
00100
virtual bool carrier();
00101
00102
00103
00104
00105
00106
virtual int speed(
int _baud);
00107 };
00108
00109
#endif