Add -out option for file output and fix stdin detection logic

- Add -out/-o option to save decode/encode output to files
- Encoded files are saved as binary, console still shows hex strings
- Decoded XML files are saved as text
- Fix stdin detection logic to prioritize command line arguments
- Add missing System.Collections.Generic import for List<string> usage
- File extension auto-processing now supports -out option
- Clean up data folder with renamed files (data0-3.dump/xml)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Arin(asus)
2025-09-07 15:45:04 +09:00
parent f9b17dd7e7
commit fdfab0c666
18 changed files with 237 additions and 121 deletions

View File

@@ -0,0 +1,5 @@
0000 33 33 00 00 00 01 10 22 33 44 55 66 86 dd 60 00 33....."3DUf..`.
0010 00 00 00 12 11 ff fe 80 00 00 00 00 00 00 12 22 ..............."
0020 33 ff fe 44 55 66 ff 02 00 00 00 00 00 00 00 00 3..DUf..........
0030 00 00 00 00 00 01 c3 51 3b 0e 00 12 c8 18 01 fe .......Q;.......
0040 90 00 00 00 00 02 10 00 ........

View File

@@ -0,0 +1,6 @@
0000 10 22 33 44 55 66 80 34 28 2e 23 dd 86 dd 60 00 ."3DUf.4(.#...`.
0010 00 00 00 24 11 ff fe 80 00 00 00 00 00 00 82 34 ...$...........4
0020 28 ff fe 2e 23 dd fe 80 00 00 00 00 00 00 12 22 (...#.........."
0030 33 ff fe 44 55 66 3b 0e c3 51 00 24 5e 42 01 fe 3..DUf;..Q.$^B..
0040 90 01 00 00 00 14 fe 80 00 00 00 00 00 00 82 34 ...............4
0050 28 ff fe 2e 23 dd d1 21 10 00 (...#..!..

View File

@@ -0,0 +1,8 @@
0000 80 34 28 2e 23 dd 10 22 33 44 55 66 86 dd 60 00 .4(.#.."3DUf..`.
0010 00 00 00 40 06 ff fe 80 00 00 00 00 00 00 12 22 ...@..........."
0020 33 ff fe 44 55 66 fe 80 00 00 00 00 00 00 82 34 3..DUf.........4
0030 28 ff fe 2e 23 dd c3 65 d1 21 00 63 9b 07 2c c5 (...#..e.!.c..,.
0040 4a 30 50 18 11 1c d4 f8 00 00 01 fe 80 01 00 00 J0P.............
0050 00 24 80 00 eb ab 93 71 d3 4b 9b 79 d1 89 a9 89 .$.....q.K.y....
0060 89 c1 d1 91 d1 91 81 89 99 d2 6b 9b 3a 23 2b 30 ..........k.:#+0
0070 02 00 00 0c 38 40 ....8@

View File

@@ -0,0 +1,6 @@
0000 10 22 33 44 55 66 80 34 28 2e 23 dd 86 dd 60 00 ."3DUf.4(.#...`.
0010 00 00 00 20 06 ff fe 80 00 00 00 00 00 00 82 34 ... ...........4
0020 28 ff fe 2e 23 dd fe 80 00 00 00 00 00 00 12 22 (...#.........."
0030 33 ff fe 44 55 66 d1 21 c3 65 2c c5 4a 30 00 63 3..DUf.!.e,.J0.c
0040 9b 33 50 18 0b 3c 96 5f 00 00 01 fe 80 01 00 00 .3P..<._........
0050 00 04 80 40 00 c0 ...@..

View File

@@ -1,7 +0,0 @@
0000 10 22 33 44 55 66 80 34 28 2e 23 dd 86 dd 60 00 ."3DUf.4(.#...`.
0010 00 00 00 33 06 ff fe 80 00 00 00 00 00 00 82 34 ...3...........4
0020 28 ff fe 2e 23 dd fe 80 00 00 00 00 00 00 12 22 (...#.........."
0030 33 ff fe 44 55 66 d1 21 c3 65 2c c5 61 f8 00 63 3..DUf.!.e,.a..c
0040 ae c9 50 18 08 a8 72 51 00 00 01 fe 80 01 00 00 ..P...rQ........
0050 00 17 80 98 02 10 50 90 8c 0c 0c 0e 0c 51 80 00 ......P......Q..
0060 00 00 20 40 c4 08 a0 30 00 .. @...0.

16
Data/test_decode.xml Normal file
View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<ns1:V2G_Message xmlns:ns1="urn:iso:15118:2:2013:MsgDef" xmlns:ns2="urn:iso:15118:2:2013:MsgHeader" xmlns:ns3="urn:iso:15118:2:2013:MsgBody" xmlns:ns4="urn:iso:15118:2:2013:MsgDataTypes">
<ns1:Header>
<ns2:SessionID>4142423030303831</ns2:SessionID>
</ns1:Header>
<ns1:Body>
<ns3:WeldingDetectionReq>
<ns3:DC_EVStatus>
<ns4:EVReady>True</ns4:EVReady>
<ns4:EVErrorCode>NO_ERROR</ns4:EVErrorCode>
<ns4:EVRESSSOC>100</ns4:EVRESSSOC>
</ns3:DC_EVStatus>
</ns3:WeldingDetectionReq>
</ns1:Body>
</ns1:V2G_Message>

View File

@@ -1 +0,0 @@
8098021050908C0C0C0E0C5211003200

BIN
Data/test_output.hex Normal file

Binary file not shown.