| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef DOSBOX_NULLMODEM_WIN32_H |
| 23 |
#define DOSBOX_NULLMODEM_WIN32_H |
| 24 |
|
| 25 |
#include "dosbox.h" |
| 26 |
|
| 27 |
#if C_MODEM |
| 28 |
|
| 29 |
#include "misc_util.h" |
| 30 |
#include "serialport.h" |
| 31 |
|
| 32 |
#define SERIAL_SERVER_POLLING_EVENT SERIAL_BASE_EVENT_COUNT+1 |
| 33 |
#define SERIAL_TX_REDUCTION SERIAL_BASE_EVENT_COUNT+2 |
| 34 |
#define SERIAL_NULLMODEM_DTR_EVENT SERIAL_BASE_EVENT_COUNT+3 |
| 35 |
#define SERIAL_NULLMODEM_EVENT_COUNT SERIAL_BASE_EVENT_COUNT+3 |
| 36 |
|
| 37 |
class CNullModem : public CSerial { |
| 38 |
public: |
| 39 |
TCPServerSocket* serversocket; |
| 40 |
TCPClientSocket* clientsocket; |
| 41 |
|
| 42 |
CNullModem(Bitu id, CommandLine* cmd); |
| 43 |
~CNullModem(); |
| 44 |
bool receiveblock; |
| 45 |
Bit16u serverport; |
| 46 |
Bit16u clientport; |
| 47 |
|
| 48 |
Bit8u hostnamebuffer[128]; |
| 49 |
|
| 50 |
void updatePortConfig(Bit16u divider, Bit8u lcr); |
| 51 |
void updateMSR(); |
| 52 |
void transmitByte(Bit8u val, bool first); |
| 53 |
void setBreak(bool value); |
| 54 |
|
| 55 |
void setRTSDTR(bool rts, bool dtr); |
| 56 |
void setRTS(bool val); |
| 57 |
void setDTR(bool val); |
| 58 |
void handleUpperEvent(Bit16u type); |
| 59 |
|
| 60 |
Bitu rx_state; |
| 61 |
#define N_RX_IDLE 0 |
| 62 |
#define N_RX_WAIT 1 |
| 63 |
#define N_RX_BLOCKED 2 |
| 64 |
#define N_RX_FASTWAIT 3 |
| 65 |
#define N_RX_DISC 4 |
| 66 |
|
| 67 |
bool doReceive(); |
| 68 |
void ClientConnect(); |
| 69 |
void Disconnect(); |
| 70 |
Bits readChar(); |
| 71 |
void WriteChar(Bit8u data); |
| 72 |
|
| 73 |
bool tx_block; |
| 74 |
|
| 75 |
|
| 76 |
Bitu rx_retry; |
| 77 |
|
| 78 |
Bitu rx_retry_max; |
| 79 |
|
| 80 |
|
| 81 |
Bitu tx_gather; |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
bool dtrrespect; |
| 86 |
|
| 87 |
|
| 88 |
bool transparent; |
| 89 |
|
| 90 |
|
| 91 |
bool telnet; |
| 92 |
|
| 93 |
|
| 94 |
#define TEL_CLIENT 0 |
| 95 |
#define TEL_SERVER 1 |
| 96 |
|
| 97 |
Bits TelnetEmulation(Bit8u data); |
| 98 |
|
| 99 |
|
| 100 |
struct { |
| 101 |
bool binary[2]; |
| 102 |
bool echo[2]; |
| 103 |
bool supressGA[2]; |
| 104 |
bool timingMark[2]; |
| 105 |
|
| 106 |
bool inIAC; |
| 107 |
bool recCommand; |
| 108 |
Bit8u command; |
| 109 |
} telClient; |
| 110 |
}; |
| 111 |
|
| 112 |
#endif |
| 113 |
#endif |