n4af / TR4W

TRLOG 4 Windows free amateur radio logging application
GNU General Public License v3.0
19 stars 6 forks source link

Convert hex values to printable in DEBUG log so we can read Icom responses. #565

Closed ny4i closed 2 years ago

ny4i commented 2 years ago

I received a log from a IC7610 user but I cannot read what the radio is sending back to us. Add code to vert this to something displayable.

05 Feb 2022 15:46:56.692 27212 [25748] trace TR4WDebugLog  - [ICOM 7610] Calling WriteFile to write 6 bytes <FEFE98E00F>
05 Feb 2022 15:46:56.828 27348 [25748] trace TR4WDebugLog  - [ReadFromSerialPort] Read ˛˛ò‡˝˛˛‡ò˝ from serial port
05 Feb 2022 15:46:56.830 27350 [25748] trace TR4WDebugLog  - >>>>Enter WriteToCATPort
05 Feb 2022 15:46:56.830 27350 [25748] trace TR4WDebugLog  - [ICOM 7610] Calling WriteFile to write 7 bytes <FEFE98E02101>
05 Feb 2022 15:46:56.968 27488 [25748] trace TR4WDebugLog  - [ReadFromSerialPort] Read ˛˛ò‡!˝˛˛‡ò!˝ from serial port
05 Feb 2022 15:46:56.968 27488 [25748] trace TR4WDebugLog  - >>>>Enter WriteToCATPort
05 Feb 2022 15:46:56.968 27488 [25748] trace TR4WDebugLog  - [ICOM 7610] Calling WriteFile to write 7 bytes <FEFE98E02100>
05 Feb 2022 15:46:57.112 27632 [25748] trace TR4WDebugLog  - [ReadFromSerialPort] Read ˛˛ò‡!˝˛˛‡ò!P˝ from serial port
05 Feb 2022 15:46:57.112 27632 [25748] trace TR4WDebugLog  - >>>>Enter WriteToCATPort
05 Feb 2022 15:46:57.112 27632 [25748] trace TR4WDebugLog  - [ICOM 7610] Calling WriteFile to write 7 bytes <FEFE98E01C00>
05 Feb 2022 15:46:57.254 27774 [25748] trace TR4WDebugLog  - [ReadFromSerialPort] Read ˛˛ò‡˝˛˛‡ò˝ from serial port
05 Feb 2022 15:46:57.270 27790 [25748] trace TR4WDebugLog  - >>>>Enter WriteToCATPort
05 Feb 2022 15:46:57.270 27790 [25748] trace TR4WDebugLog  - [ICOM 7610] Calling WriteFile to write 7 bytes <FEFE98E02500>
05 Feb 2022 15:46:57.409 27929 [25748] trace TR4WDebugLog  - [ReadFromSerialPort] Read ˛˛ò‡%˝˛˛‡ò%p˝ from serial port
05 Feb 2022 15:46:57.409 27929 [25748] trace TR4WDebugLog  - >>>>Enter WriteToCATPort
05 Feb 2022 15:46:57.409 27929 [25748] trace TR4WDebugLog  - [ICOM 7610] Calling WriteFile to write 7 bytes <FEFE98E02600>
05 Feb 2022 15:46:57.550 28070 [25748] trace TR4WDebugLog  - [ReadFromSerialPort] Read ˛˛ò‡&˝˛˛‡ò&˝ from serial port
ny4i commented 2 years ago

Well this is puzzling. On my system (Windows 10), when I use the IC7300, my log appears as follows:

05 Feb 2022 14:11:04.141 759874 [2324] trace TR4WDebugLog - [ReadFromSerialPort] Read FE FE 94 E0 26 00 FD FE FE E0 94 26 00 01 01 01 FD from serial port 05 Feb 2022 14:11:04.144 759877 [2324] trace TR4WDebugLog - >>>>Enter WriteToCATPort 05 Feb 2022 14:11:04.144 759877 [2324] trace TR4WDebugLog - [IC7300-COM4] Calling WriteFile to write 7 bytes 05 Feb 2022 14:11:04.281 760014 [2324] trace TR4WDebugLog - [ReadFromSerialPort] Read FE FE 94 E0 25 01 FD FE FE E0 94 25 01 00 00 10 14 00 FD from serial port 05 Feb 2022 14:11:04.281 760014 [2324] trace TR4WDebugLog - >>>>Enter WriteToCATPort 05 Feb 2022 14:11:04.281 760014 [2324] trace TR4WDebugLog - [IC7300-COM4] Calling WriteFile to write 7 bytes 05 Feb 2022 14:11:04.421 760154 [2324] trace TR4WDebugLog - [ReadFromSerialPort] Read FE FE 94 E0 26 01 FD FE FE E0 94 26 01 01 00 02 FD from serial port 05 Feb 2022 14:11:04.426 760159 [2324] trace TR4WDebugLog - >>>>Enter WriteToCATPort 05 Feb 2022 14:11:04.426 760159 [2324] trace TR4WDebugLog - [IC7300-COM4] Calling WriteFile to write 6 bytes 05 Feb 2022 14:11:04.562 760295 [2324] trace TR4WDebugLog - [ReadFromSerialPort] Read FE FE 94 E0 0F FD FE FE E0 94 0F 00 FD from serial port 05 Feb 2022 14:11:04.563 760296 [2324] trace TR4WDebugLog - >>>>Enter WriteToCATPort 05 Feb 2022 14:11:04.563 760296 [2324] trace TR4WDebugLog - [IC7300-COM4] Calling WriteFile to write 7 bytes 05 Feb 2022 14:11:04.700 760433 [2324] trace TR4WDebugLog - [ReadFromSerialPort] Read FE FE 94 E0 21 01 FD FE FE E0 94 21 01 00 FD from serial port