Even better debugging output

I had at one point implemented "super verbose" output for the serial transport, problem was that it printed out every time ReadByte() was called, even if the underlying failed in "no wait" mode. This caused scads of output of the same character when the TransportThread was simply waiting for a command. The update ensures there is only output when the read is successful. Making things so much easier to follow...

Using the new debugging output I was able to find the bug I was experiencing where the thread locked after the first command. I fixed that and was quickly presented with this output

plcd[7554]: Network thread successfully initialized on port 1972
plcd[7554]: Using PLM protocol
plcd[7554]: Using serial transport
OPened socket 6
plcd[7554]: Network thread received: on for 00000001
plcd[7554]: GetDevice: Creating a new device 00000001
plcd[7554]: Expanding Macro: outside lights
plcd[7554]: Transmission sending command: on to 00000001
plcd[7554]: Transmission sending command: on to 00146c07
plcd[7554]: SerialTransport::WriteByte '' 02
plcd[7554]: SerialTransport::WriteByte 'b' 62
plcd[7554]: SerialTransport::WriteByte '' 14
plcd[7554]: SerialTransport::WriteByte 'l' 6c
plcd[7554]: SerialTransport::WriteByte '' 07
plcd[7554]: SerialTransport::WriteByte '' 00
plcd[7554]: SerialTransport::WriteByte '' 11
plcd[7554]: SerialTransport::WriteByte 'ÿ' ff
plcd[7554]: PLMProtocol sent: 0262146c070011ff
plcd[7554]: SerialTransport::ReadByte '' 02
plcd[7554]: SerialTransport::ReadByte 'b' 62
plcd[7554]: SerialTransport::ReadByte '' 14
plcd[7554]: SerialTransport::ReadByte 'l' 6c
plcd[7554]: SerialTransport::ReadByte '' 07
plcd[7554]: SerialTransport::ReadByte '' 00
plcd[7554]: SerialTransport::ReadByte 'ÿ' ff
plcd[7554]: SerialTransport::ReadByte '' 06
plcd[7554]: PLMProtocol received ack: 0262146c0700ff06
plcd[7554]: Transmission sending command: on to 001b8b19
plcd[7554]: SerialTransport::WriteByte '' 02
plcd[7554]: SerialTransport::WriteByte 'b' 62
plcd[7554]: SerialTransport::WriteByte 'b
plcd[7554]: SerialTransport::WriteByte '' 8b
plcd[7554]: SerialTransport::WriteByte '' 19
plcd[7554]: SerialTransport::WriteByte '' 00
plcd[7554]: SerialTransport::WriteByte '' 11
plcd[7554]: SerialTransport::WriteByte 'ÿ' ff
plcd[7554]: PLMProtocol sent: 02621b8b190011ff
plcd[7554]: SerialTransport::ReadByte '' 15
plcd[7554]: SerialTransport::ReadByte '' 15
plcd[7554]: SerialTransport::ReadByte '' 15
plcd[7554]: SerialTransport::ReadByte '' 15
plcd[7554]: SerialTransport::ReadByte '' 15
plcd[7554]: SerialTransport::ReadByte '' 15
plcd[7554]: SerialTransport::ReadByte '' 02
plcd[7554]: SerialTransport::ReadByte 'P' 50
plcd[7554]: PLMProtocol received nak(1): 1515151515150250
plcd[7554]: SerialTransport::WriteByte '' 02
plcd[7554]: SerialTransport::WriteByte 'b' 62
plcd[7554]: SerialTransport::WriteByte 'b
plcd[7554]: SerialTransport::WriteByte '' 8b
plcd[7554]: SerialTransport::WriteByte '' 19
plcd[7554]: SerialTransport::WriteByte '' 00
plcd[7554]: SerialTransport::WriteByte '' 11
plcd[7554]: SerialTransport::WriteByte 'ÿ' ff
plcd[7554]: PLMProtocol sent: 02621b8b190011ff
plcd[7554]: SerialTransport::ReadByte '' 14
plcd[7554]: SerialTransport::ReadByte 'l' 6c
plcd[7554]: SerialTransport::ReadByte '' 07
plcd[7554]: SerialTransport::ReadByte '' 1c
plcd[7554]: SerialTransport::ReadByte 'ô' f4
plcd[7554]: SerialTransport::ReadByte '`' 60
plcd[7554]: SerialTransport::ReadByte '!' 21
plcd[7554]: SerialTransport::ReadByte 'ÿ' ff
plcd[7554]: PLMProtocol received nak(2): 146c071cf46021ff
plcd[7554]: SerialTransport::WriteByte '' 02
plcd[7554]: SerialTransport::WriteByte 'b' 62
plcd[7554]: SerialTransport::WriteByte 'b
plcd[7554]: SerialTransport::WriteByte '' 8b
plcd[7554]: SerialTransport::WriteByte '' 19
plcd[7554]: SerialTransport::WriteByte '' 00
plcd[7554]: SerialTransport::WriteByte '' 11
plcd[7554]: SerialTransport::WriteByte 'ÿ' ff
plcd[7554]: PLMProtocol sent: 02621b8b190011ff
plcd[7554]: SerialTransport::ReadByte '' 02
plcd[7554]: SerialTransport::ReadByte 'b' 62
plcd[7554]: SerialTransport::ReadByte 'b
plcd[7554]: SerialTransport::ReadByte '' 8b
plcd[7554]: SerialTransport::ReadByte '' 19
plcd[7554]: SerialTransport::ReadByte '' 00
plcd[7554]: SerialTransport::ReadByte 'ÿ' ff
plcd[7554]: SerialTransport::ReadByte '' 06
plcd[7554]: PLMProtocol received ack: 02621b8b1900ff06
plcd[7554]: SerialTransport::ReadByte '' 15
plcd[7554]: SerialTransport::ReadByte '' 15
plcd[7554]: SerialTransport::ReadByte '' 15
plcd[7554]: SerialTransport::ReadByte '' 15
plcd[7554]: SerialTransport::ReadByte '' 15
plcd[7554]: SerialTransport::ReadByte '' 02
plcd[7554]: SerialTransport::ReadByte 'P' 50
plcd[7554]: SerialTransport::ReadByte 'b
plcd[7554]: SerialTransport::ReadByte '' 8b
plcd[7554]: SerialTransport::ReadByte '' 19
plcd[7554]: SerialTransport::ReadByte '' 1c
plcd[7554]: SerialTransport::ReadByte 'ô' f4
plcd[7554]: SerialTransport::ReadByte '`' 60
plcd[7554]: SerialTransport::ReadByte '"' 22
plcd[7554]: SerialTransport::ReadByte 'ÿ' ff
plcd[7554]: PLMProtocol received: 02501b8b191cf46022ffff
 

This is after I sent an on command to the macro that is my outside lights. as you can see there is a weird response mixed in with the ack/nak feedback of the second transmission. I have to deal with that, but I am not sure exactly how...

Subject: