Problems with my packet structure (633)

pskhaat

New member
So I've had some issues getting my Linux terminal servers to send data packets. I've switched these over to Windows. The serial ports are connected to TCP ports as the controlling software is Java and portable serial port control is Java is a joke still. 'nough of that.

This very simple example to clear the screen does not seem to be honored, however the same packet (apparently) via the CFA633 packet debugger (test prog) shows the same thing:
Code:
	OutputStream os; // this comes from either a socket, or javax.comm or file os, etc

	// I want to clear the screen:
	byte[] ba0 = new byte[4];
	ba0[0] = 0x06;
	ba0[1] = 0x00;
	ba0[2] = 0x5b;
	ba0[3] = (byte)0x97;
	System.out.println("sending");
	System.out.println(new java.math.BigInteger(ba0).toString(2)); 
	// that value as base2 seems to be exactly what I want to send
	// 0000 0110 | 0000 0000 | 0101 1011 | 1001 0111

	os.write(ba0);
	os.flush();
Does something look so terribly off?
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

pskhaat

New member
I think I have my answer, and I would like some clarity around this? I obtained a serial port sniffer and evaluated the bits that were being sent.

I had made the assumption that the CRC for a clear LCD packet as listed in WinTest b1.9 was 0x5B97. Apparently however the CRC bytes need swabbing? Here's the updated code which works just fine:

Code:
byte[] ba0 = new byte[4];
ba0[0] = 0x06;
ba0[1] = 0x00;
ba0[2] = (byte)0x97;
ba0[3] = 0x5b;
Did I completely miss this in the documentation?

Here's the old assumed code:
Code:
byte[] ba0 = new byte[4];
ba0[0] = 0x06;
ba0[1] = 0x00;
ba0[2] = 0x5b;
ba0[3] = (byte)0x97;
 
Top