1 package net.sf.atmodem4j.spsw;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 import java.io.IOException;
32
33
34
35
36
37 public class GenericWinSerialPortSocket extends AbstractSerialPortSocket {
38
39
40
41
42
43 private long fd = -1;
44
45 public GenericWinSerialPortSocket(String portName) {
46 super(portName);
47 }
48
49 @Override
50 protected native void open(String portName, int type) throws IOException;
51
52
53
54
55 protected native void close0() throws IOException;
56
57 @Override
58 public native boolean isCTS();
59
60 @Override
61 public native boolean isDSR();
62
63 @Override
64 public native boolean isIncommingRI();
65
66 @Override
67 public native void setRTS(boolean value) throws IOException;
68
69 @Override
70 public native void setDTR(boolean value) throws IOException;
71
72 @Override
73 public native void sendXON() throws IOException;
74
75 @Override
76 public native void sendXOFF() throws IOException;
77
78 @Override
79 public native void setXONChar(char c) throws IOException;
80
81 @Override
82 public native void setXOFFChar(char c) throws IOException;
83
84 @Override
85 protected native int readSingle() throws IOException;
86
87
88
89
90
91
92
93
94
95 @Override
96 protected native int readBytes(byte[] b, int off, int len) throws IOException;
97
98 @Override
99 protected native void writeSingle(int b) throws IOException;
100
101
102
103
104
105
106
107
108 @Override
109 protected native void writeBytes(byte[] b, int off, int len) throws IOException;
110
111 @Override
112 public native int getInBufferBytesCount() throws IOException;
113
114 @Override
115 public native int getOutBufferBytesCount() throws IOException;
116
117 @Override
118 protected native void setFlowControl(int mask) throws IOException;
119
120 @Override
121 protected native int getFlowControl0() throws IOException;
122
123 @Override
124 public native void setBreak(boolean value) throws IOException;
125
126 @Override
127 protected native void setBaudrate(int baudRate) throws IOException;
128
129 @Override
130 protected native void setDataBits(int value) throws IOException;
131
132 @Override
133 protected native void setStopBits(int value) throws IOException;
134
135 @Override
136 protected native void setParity(int parity) throws IOException;
137
138 @Override
139 protected native int getBaudrate0() throws IOException;
140
141 @Override
142 protected native int getDataBits0() throws IOException;
143
144 @Override
145 protected native int getStopBits0() throws IOException;
146
147 @Override
148 protected native int getParity0() throws IOException;
149
150 @Override
151 public native char getXONChar() throws IOException;
152
153 @Override
154 public native char getXOFFChar() throws IOException;
155
156 }