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 GenericTermiosSerialPortSocket extends AbstractSerialPortSocket {
38
39
40
41
42 private int fd = -1;
43
44 public GenericTermiosSerialPortSocket(String portName) {
45 super(portName);
46 }
47
48 @Override
49 protected native void open(String portName, int type) throws IOException;
50
51
52
53
54 @Override
55 protected native void close0() throws IOException;
56
57 @Override
58 public native boolean isCTS();
59
60 public native boolean isRTS();
61
62 @Override
63 public native boolean isDSR();
64
65 public native boolean isDTR();
66
67 @Override
68 public native boolean isIncommingRI();
69
70 @Override
71 public native void setRTS(boolean value) throws IOException;
72
73 @Override
74 public native void setDTR(boolean value) throws IOException;
75
76 @Override
77 public native void setXONChar(char c) throws IOException;
78
79 @Override
80 public native void setXOFFChar(char c) throws IOException;
81
82 @Override
83 protected native int readSingle() throws IOException;
84
85
86
87
88
89
90
91
92
93 @Override
94 protected native int readBytes(byte[] b, int off, int len) throws IOException;
95
96 @Override
97 protected native void writeSingle(int b) throws IOException;
98
99
100
101
102
103
104
105
106 @Override
107 protected native void writeBytes(byte[] b, int off, int len) throws IOException;
108
109 @Override
110 public native int getInBufferBytesCount() throws IOException;
111
112 @Override
113 public native int getOutBufferBytesCount() throws IOException;
114
115 @Override
116 protected native void setFlowControl(int mask) throws IOException;
117
118 @Override
119 protected native int getFlowControl0() throws IOException;
120
121 @Override
122 public native void setBreak(boolean value) throws IOException;
123
124 @Override
125 protected native void setBaudrate(int baudRate) throws IOException;
126
127 @Override
128 protected native void setDataBits(int value) throws IOException;
129
130 @Override
131 protected native void setStopBits(int value) throws IOException;
132
133 @Override
134 protected native void setParity(int parity) throws IOException;
135
136 @Override
137 protected native int getBaudrate0() throws IOException;
138
139 @Override
140 protected native int getDataBits0() throws IOException;
141
142 @Override
143 protected native int getStopBits0() throws IOException;
144
145 @Override
146 protected native int getParity0() throws IOException;
147
148 @Override
149 public native char getXONChar() throws IOException;
150
151 @Override
152 public native char getXOFFChar() throws IOException;
153
154 public native void printTermios() throws IOException;
155
156 @Override
157 public native void sendXON() throws IOException;
158
159 @Override
160 public native void sendXOFF() throws IOException;
161 }