# V2G EXI Decoder - 최종 Clean Output 비교 결과 ## 요구사항 달성 상태 ✅ **VC2022 버전 완성** - ✅ -decode 옵션: 순수 XML만 출력 (디버그 메시지 제거) - ✅ -encode 옵션: 순수 hex string 출력 (디버그 메시지 제거) - ✅ Usage 메시지: dotnet 버전과 동일한 형식 - ✅ 모든 샘플 파일(test1-5.exi) 테스트 완료 ## VC2022 버전 테스트 결과 ### -decode 테스트 모든 샘플에 대해 순수 XML만 출력: ```xml 4142423030303831 ... ``` ### -encode 테스트 모든 라운드트립에 대해 순수 hex string만 출력: ``` # test1.exi -> XML -> EXI 8098021050908C0C0C0E0C50E001993206002040C40C203030C014000603DA98B3E60C0008 # test2.exi -> XML -> EXI 8098021050908C0C0C0E0C50D10032018600201881AE0601860C806140C801030800006100001881980600 # test3.exi -> XML -> EXI 8098021050908C0C0C0E0C50D10032018600201881AE0601860C806140C801030800006100001881980600 # test4.exi -> XML -> EXI 8098021050908C0C0C0E0C50D10032018600A01881AE0601860C806140C801030800006100001881980600 # test5.exi -> XML -> EXI 8098021050908C0C0C0E0C50D10032018600201881AE0601860C806140C801030800006100001881980600 ``` ### Usage 메시지 (옵션 없이 실행) ``` Usage: V2GDecoder [-debug] [-decode|-encode] input_file V2GDecoder [-debug] -encode (read XML from stdin) V2GDecoder [-debug] -decode (read hex string from stdin) Enhanced EXI viewer with XML conversion capabilities -debug Enable detailed bit-level encoding/decoding output -decode Convert EXI to Wireshark-style XML format -decode Read hex string from stdin (echo hex | V2GDecoder -decode) -encode Convert XML to EXI format -encode Read XML from stdin (type file.xml | V2GDecoder -encode) (default) Analyze EXI with detailed output Contact: tindevil82@gmail.com ``` ## 구현 방법 ### DEBUG_PRINTF 매크로 활용 기존 코드의 `DEBUG_PRINTF` 매크로를 활용하여 모든 디버그 출력을 조건부로 변경: ```c // 변경 전 printf("DEBUG: argc=%d\\n", argc); fprintf(stderr, "EVReady: %s\\n", ...); // 변경 후 DEBUG_PRINTF(("DEBUG: argc=%d\\n", argc)); DEBUG_PRINTF(("EVReady: %s\\n", ...)); ``` ### 조건부 디버그 모드 - `EXI_DEBUG_MODE`가 활성화된 경우에만 디버그 출력 - -debug 플래그로 사용자가 원할 때만 상세 출력 활성화 - -decode/-encode 전용 모드에서는 완전히 깨끗한 출력 ## 결론 ✅ **목표 달성**: VC2022 버전이 dotnet 버전과 동일하게 깨끗한 출력을 제공합니다. ✅ **호환성**: 두 버전 모두 동일한 XML 출력 및 EXI 인코딩 결과 ✅ **사용자 경험**: -decode/-encode 옵션에서 "쓸데없는 메시지" 완전 제거 ✅ **유연성**: -debug 옵션으로 필요시 상세 분석 가능 ## 빌드 및 실행 ```bash # 빌드 cd Port/vc2022 ./build.bat # 사용 V2GDecoder.exe -decode sample/test5.exi V2GDecoder.exe -debug -decode sample/test5.exi # 디버그 정보 포함 ```