Add support for pipe input and file extension handling
- Added stdin pipe support for both encode and decode operations - Implemented file extension-based processing: * .dump files: hex dump format with arrow separators * .hex files: pure hex string data * .xml files: XML content for encoding - Added 'filename --encode' and 'filename --decode' syntax support - Enhanced command line parsing for flexible usage - Updated help text with pipe usage examples 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
7
Data/dump0.dump
Normal file
7
Data/dump0.dump
Normal file
@@ -0,0 +1,7 @@
|
||||
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.
|
||||
7
Data/dump1.dump
Normal file
7
Data/dump1.dump
Normal file
@@ -0,0 +1,7 @@
|
||||
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 4a 3c 00 63 3..DUf.!.e,.J<.c
|
||||
0040 9b 49 50 18 0b 26 2f bd 00 00 01 fe 80 01 00 00 .IP..&/.........
|
||||
0050 00 17 80 98 02 10 50 90 8c 0c 0c 0e 0c 51 e0 20 ......P......Q.
|
||||
0060 25 69 68 c0 c0 c0 c0 c0 80 %ih......
|
||||
7
Data/dump2.dump
Normal file
7
Data/dump2.dump
Normal file
@@ -0,0 +1,7 @@
|
||||
0000 80 34 28 2e 23 dd 10 22 33 44 55 66 86 dd 60 00 .4(.#.."3DUf..`.
|
||||
0010 00 00 00 2c 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 7d 20 74 2c e1 (...#..e.!.} t,.
|
||||
0040 d2 0a 50 18 11 1c 49 71 00 00 01 fe 80 01 00 00 ..P...Iq........
|
||||
0050 00 10 80 98 02 10 50 90 8c 0c 0c 0e 0c 52 11 00 ......P......R..
|
||||
0060 32 00 2.
|
||||
15
Data/encode0.xml
Normal file
15
Data/encode0.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?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>
|
||||
22
Data/encode1.xml
Normal file
22
Data/encode1.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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:WeldingDetectionRes>
|
||||
<ns3:ResponseCode>OK</ns3:ResponseCode>
|
||||
<ns3:DC_EVSEStatus>
|
||||
<ns4:NotificationMaxDelay>0</ns4:NotificationMaxDelay>
|
||||
<ns4:EVSENotification>StopCharging</ns4:EVSENotification>
|
||||
<ns4:EVSEIsolationStatus>Invalid</ns4:EVSEIsolationStatus>
|
||||
<ns4:EVSEStatusCode>EVSE_Shutdown</ns4:EVSEStatusCode>
|
||||
</ns3:DC_EVSEStatus>
|
||||
<ns3:EVSEPresentVoltage>
|
||||
<ns4:Multiplier>0</ns4:Multiplier>
|
||||
<ns4:Unit>V</ns4:Unit>
|
||||
<ns4:Value>449</ns4:Value>
|
||||
</ns3:EVSEPresentVoltage>
|
||||
</ns3:WeldingDetectionRes>
|
||||
</ns1:Body>
|
||||
</ns1:V2G_Message>
|
||||
22
Data/encode2.xml
Normal file
22
Data/encode2.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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>41424230303038313</ns2:SessionID>
|
||||
</ns1:Header>
|
||||
<ns1:Body>
|
||||
<ns3:PreChargeRes>
|
||||
<ns3:ResponseCode>OK</ns3:ResponseCode>
|
||||
<ns3:DC_EVSEStatus>
|
||||
<ns4:NotificationMaxDelay>0</ns4:NotificationMaxDelay>
|
||||
<ns4:EVSENotification>None</ns4:EVSENotification>
|
||||
<ns4:EVSEIsolationStatus>Valid</ns4:EVSEIsolationStatus>
|
||||
<ns4:EVSEStatusCode>EVSE_Ready</ns4:EVSEStatusCode>
|
||||
</ns3:DC_EVSEStatus>
|
||||
<ns3:EVSEPresentVoltage>
|
||||
<ns4:Multiplier>0</ns4:Multiplier>
|
||||
<ns4:Unit>V</ns4:Unit>
|
||||
<ns4:Value>394</ns4:Value>
|
||||
</ns3:EVSEPresentVoltage>
|
||||
</ns3:PreChargeRes>
|
||||
</ns1:Body>
|
||||
</ns1:V2G_Message>
|
||||
1
Data/test_exi.hex
Normal file
1
Data/test_exi.hex
Normal file
@@ -0,0 +1 @@
|
||||
8098021050908C0C0C0E0C5211003200
|
||||
Reference in New Issue
Block a user