Hi I have to translate vb-code to java-code. I have a little reader with some chips and I have to get some data from the chips. The problem is, that i can't get the data from the chips. In vb it works well.
the vb-code is the following:
'Open connection MSComm1.CommPort = 1 MSComm1.PortOpen = True 'Without this, it doesn't work Sleep (100)
Sleep (100) temp = MSComm1.Input --> temp = a number like this, if a chip is on the reader: 0,8004EA56; or 5 if nothing is on the reader.
----------- In the java code I make this to connect and get output and inputstream:
try { portId = CommPortIdentifier.getPortIdentifier("COM1"); serialPort = (SerialPort) portId.open("Reader", 2000); serialPort.setSerialPortParams(4800, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); out = serialPort.getOutputStream(); in = serialPort.getInputStream(); CopyThread input = new CopyThread(System.in,out, "Input"); CopyThread output = new CopyThread(in,System.out, "Output");
} catch (Exception e) {}
The problem is, that i don't know how to get data from the chip and the reader. The stream are something like this: com.sun.comm.Win32SerialInputStream@15a6029 What can I do to get the same numbers as them in vb?