10 abstract class RS232Device
implements NamedDevice {
11 private final PortCommunicator portCommunicator;
12 protected final String deviceName;
19 public RS232Device(String deviceName, PortCommunicator portCommunicator){
20 this.deviceName = deviceName;
21 this.portCommunicator = portCommunicator;
28 protected String read() throws IOException {
30 InputStreamReader inputStreamReader =
new InputStreamReader
33 BufferedReader inputStreamBuffer =
new BufferedReader
36 return inputStreamBuffer.readLine();
43 protected void write(String commandToWrite)
throws IOException {
44 OutputStream outputStream = this.portCommunicator.getOutputStream();
45 OutputStreamWriter streamWriter =
new OutputStreamWriter(outputStream);
46 BufferedWriter buffer =
new BufferedWriter(streamWriter);
48 buffer.write(commandToWrite);
InputStream getInputStream()