| 1 |
|
| 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 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
package gnu.io; |
| 59 |
import java.io.*; |
| 60 |
import java.util.*; |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
public abstract class SerialPort extends CommPort { |
| 69 |
public static final int DATABITS_5 =5; |
| 70 |
public static final int DATABITS_6 =6; |
| 71 |
public static final int DATABITS_7 =7; |
| 72 |
public static final int DATABITS_8 =8; |
| 73 |
public static final int PARITY_NONE =0; |
| 74 |
public static final int PARITY_ODD =1; |
| 75 |
public static final int PARITY_EVEN =2; |
| 76 |
public static final int PARITY_MARK =3; |
| 77 |
public static final int PARITY_SPACE =4; |
| 78 |
public static final int STOPBITS_1 =1; |
| 79 |
public static final int STOPBITS_2 =2; |
| 80 |
public static final int STOPBITS_1_5 =3; |
| 81 |
public static final int FLOWCONTROL_NONE =0; |
| 82 |
public static final int FLOWCONTROL_RTSCTS_IN =1; |
| 83 |
public static final int FLOWCONTROL_RTSCTS_OUT =2; |
| 84 |
public static final int FLOWCONTROL_XONXOFF_IN =4; |
| 85 |
public static final int FLOWCONTROL_XONXOFF_OUT=8; |
| 86 |
|
| 87 |
public abstract void setSerialPortParams( int b, int d, int s, int p ) |
| 88 |
throws UnsupportedCommOperationException; |
| 89 |
public abstract int getBaudRate(); |
| 90 |
public abstract int getDataBits(); |
| 91 |
public abstract int getStopBits(); |
| 92 |
public abstract int getParity(); |
| 93 |
public abstract void setFlowControlMode( int flowcontrol ) |
| 94 |
throws UnsupportedCommOperationException; |
| 95 |
public abstract int getFlowControlMode(); |
| 96 |
public abstract boolean isDTR(); |
| 97 |
public abstract void setDTR( boolean state ); |
| 98 |
public abstract void setRTS( boolean state ); |
| 99 |
public abstract boolean isCTS(); |
| 100 |
public abstract boolean isDSR(); |
| 101 |
public abstract boolean isCD(); |
| 102 |
public abstract boolean isRI(); |
| 103 |
public abstract boolean isRTS(); |
| 104 |
public abstract void sendBreak( int duration ); |
| 105 |
public abstract void addEventListener( SerialPortEventListener lsnr ) |
| 106 |
throws TooManyListenersException; |
| 107 |
public abstract void removeEventListener(); |
| 108 |
public abstract void notifyOnDataAvailable( boolean enable ); |
| 109 |
public abstract void notifyOnOutputEmpty( boolean enable ); |
| 110 |
public abstract void notifyOnCTS( boolean enable ); |
| 111 |
public abstract void notifyOnDSR( boolean enable ); |
| 112 |
public abstract void notifyOnRingIndicator( boolean enable ); |
| 113 |
public abstract void notifyOnCarrierDetect( boolean enable ); |
| 114 |
public abstract void notifyOnOverrunError( boolean enable ); |
| 115 |
public abstract void notifyOnParityError( boolean enable ); |
| 116 |
public abstract void notifyOnFramingError( boolean enable ); |
| 117 |
public abstract void notifyOnBreakInterrupt( boolean enable ); |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
public abstract byte getParityErrorChar( ) |
| 133 |
throws UnsupportedCommOperationException; |
| 134 |
public abstract boolean setParityErrorChar( byte b ) |
| 135 |
throws UnsupportedCommOperationException; |
| 136 |
public abstract byte getEndOfInputChar( ) |
| 137 |
throws UnsupportedCommOperationException; |
| 138 |
public abstract boolean setEndOfInputChar( byte b ) |
| 139 |
throws UnsupportedCommOperationException; |
| 140 |
public abstract boolean setUARTType(String type, boolean test) |
| 141 |
throws UnsupportedCommOperationException; |
| 142 |
public abstract String getUARTType() |
| 143 |
throws UnsupportedCommOperationException; |
| 144 |
public abstract boolean setBaudBase(int BaudBase) |
| 145 |
throws UnsupportedCommOperationException, |
| 146 |
IOException; |
| 147 |
public abstract int getBaudBase() |
| 148 |
throws UnsupportedCommOperationException, |
| 149 |
IOException; |
| 150 |
public abstract boolean setDivisor(int Divisor) |
| 151 |
throws UnsupportedCommOperationException, |
| 152 |
IOException; |
| 153 |
public abstract int getDivisor() |
| 154 |
throws UnsupportedCommOperationException, |
| 155 |
IOException; |
| 156 |
public abstract boolean setLowLatency() |
| 157 |
throws UnsupportedCommOperationException; |
| 158 |
public abstract boolean getLowLatency() |
| 159 |
throws UnsupportedCommOperationException; |
| 160 |
public abstract boolean setCallOutHangup(boolean NoHup) |
| 161 |
throws UnsupportedCommOperationException; |
| 162 |
public abstract boolean getCallOutHangup() |
| 163 |
throws UnsupportedCommOperationException; |
| 164 |
} |