Files
V2GDecoderC/Port/vc2022
gram bfd5fc6fe1 feat: Complete V2G EXI encoder-decoder 100% VC2022 compatibility
🔧 Grammar 279 Critical Fix:
- Fixed Grammar 279 from 2-bit to 1-bit choice for ChargingComplete
- Achieved 100% binary compatibility with VC2022 C++ implementation
- All EXI roundtrip tests now pass with identical byte output

 ANSI Banner & UI Enhancements:
- Added beautiful ANSI art banner for usage display
- Cleaned up usage messages, removed debug options from public view
- Added contact email: tindevil82@gmail.com

🛠️ Technical Improvements:
- Standardized encodeNBitUnsignedInteger naming across all Grammar states
- Added comprehensive debug logging for bit-level operations
- Enhanced binary output handling for Windows console redirection
- Improved error reporting for encoding failures

📊 Verification Results:
- test5.exi: 100% binary match between C, dotnet, and VC2022
- All 43 bytes identical: 80 98 02 10 50 90 8c 0c 0c 0e 0c 50 d1 00 32 01 86 00 20 18
- Grammar state machine now perfectly aligned with OpenV2G C implementation

🚀 Ready for expansion to additional V2G message types

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 23:17:25 +09:00
..

V2G EXI Decoder - Visual Studio 2022 VC++ Project

개요

OpenV2G EXI 디코더를 Visual Studio 2022 Professional에서 디버깅할 수 있도록 VC++ 프로젝트로 변환한 버전입니다.

프로젝트 구조

솔루션: V2GDecoderC.sln

  • V2GDecoder: 메인 EXI 디코더 애플리케이션
  • HexToBinary: 16진수 문자열을 바이너리로 변환하는 유틸리티
  • HexDumpToBinary: 16진수 덤프를 바이너리로 변환하는 유틸리티

빌드 설정

  • 플랫폼: Win32 (x86), x64
  • 구성: Debug, Release
  • 컴파일러: MSVC v143 (Visual Studio 2022)
  • 언어: Pure C (C++이 아님)
  • 출력 디렉토리: bin/{Platform}/{Configuration}/

소스 파일 구성

codec/ (EXI 코덱 핵심)

  • BitInputStream.c/h - 비트 스트림 입력
  • BitOutputStream.c/h - 비트 스트림 출력
  • DecoderChannel.c/h - 디코더 채널
  • EncoderChannel.c/h - 인코더 채널
  • EXIHeaderDecoder.c/h - EXI 헤더 디코더
  • 기타 EXI 관련 파일들

iso1/ (ISO 15118-1 구현)

  • iso1EXIDatatypes.c/h - ISO1 EXI 데이터 타입
  • iso1EXIDatatypesDecoder.c/h - ISO1 EXI 디코더
  • iso1EXIDatatypesEncoder.c/h - ISO1 EXI 인코더

appHandshake/ (애플리케이션 핸드셰이크)

  • appHandEXIDatatypes.c/h - 핸드셰이크 데이터 타입
  • appHandEXIDatatypesDecoder.c/h - 핸드셰이크 디코더
  • appHandEXIDatatypesEncoder.c/h - 핸드셰이크 인코더

Visual Studio에서 사용하기

1. 프로젝트 열기

파일 -> 열기 -> 프로젝트/솔루션 -> V2GDecoderC.sln 선택

2. 빌드하기

  • Debug x64 구성을 권장 (완전한 디버깅 정보 포함)
  • 빌드 -> 솔루션 빌드 (Ctrl+Shift+B)

3. 디버깅하기

  • V2GDecoder 프로젝트를 시작 프로젝트로 설정
  • F5로 디버깅 시작
  • 중단점 설정하여 단계별 디버깅 가능

4. 커맨드 라인 인수 설정

프로젝트 속성 -> 디버깅 -> 명령 인수에서 테스트 파일 지정:

../../test4.exi

장점

🔍 강력한 디버깅 기능

  • 중단점: 모든 C 소스 라인에 중단점 설정 가능
  • 단계별 실행: F10 (Step Over), F11 (Step Into)
  • 변수 조사: 지역 변수, 감시 창에서 실시간 변수 값 확인
  • 호출 스택: 함수 호출 경로 추적
  • 메모리 뷰: 원시 메모리 내용 확인

📊 코드 분석 도구

  • IntelliSense: 코드 완성, 함수 시그니처 힌트
  • 정의로 이동: F12로 함수/변수 정의 위치로 이동
  • 참조 찾기: 함수/변수 사용 위치 검색
  • 오류 목록: 컴파일 오류/경고 실시간 표시

🚀 .NET 포팅 지원

  • C 코드 로직을 단계별로 분석하여 C#/.NET으로 포팅 가능
  • 메모리 레이아웃, 비트 조작 등 저수준 동작 확인
  • 함수별 입출력 값 확인으로 테스트 케이스 생성

테스트 파일

  • test4.exi - 43바이트 CurrentDemandReq 메시지
  • test5.exi - 43바이트 CurrentDemandReq 메시지 (다른 값)

원본 GCC 빌드와의 호환성

  • 동일한 소스 파일 사용
  • 동일한 헤더 파일 포함 경로
  • 동일한 전처리기 정의
  • Windows에서 POSIX 호환성 유지

사용 예시

# Visual Studio에서 빌드 후
bin/x64/Debug/V2GDecoder.exe ../../test4.exi

이제 Visual Studio 2022의 강력한 디버깅 기능을 활용하여 OpenV2G EXI 디코더를 분석하고 .NET 포팅 작업을 효율적으로 수행할 수 있습니다.