- Implement complete CurrentDemandReq/CurrentDemandRes parsing (24 total fields) - Add enhanced_exi_viewer.c with detailed message analysis - Support -decode option for clean XML output (file-ready format) - Enable ISO1, ISO2, DIN codec support in build configuration - Fix C99 compatibility issues in makefiles (change -ansi to -std=c99) - Create test utilities for hex string to EXI conversion - Generate test files: test3.exi (CurrentDemandRes), test4.exi (CurrentDemandReq) Features: * Dual output modes: detailed analysis (default) vs XML (-decode) * Complete V2G message type detection and parsing * Session ID display in hex and ASCII formats * Voltage/current/power readings with proper units * All optional fields and status flags supported 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
24 lines
623 B
C
24 lines
623 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
int main() {
|
|
const char* hex_string = "8098021050908C0C0C0E0C50D10032018600A01881AE0601860C806140C801030800006100001881980600";
|
|
FILE* file = fopen("test4.exi", "wb");
|
|
|
|
if (!file) {
|
|
printf("Error creating test4.exi\n");
|
|
return -1;
|
|
}
|
|
|
|
size_t len = strlen(hex_string);
|
|
for (size_t i = 0; i < len; i += 2) {
|
|
unsigned int byte;
|
|
sscanf(&hex_string[i], "%2x", &byte);
|
|
fputc(byte, file);
|
|
}
|
|
|
|
fclose(file);
|
|
printf("test4.exi created successfully (%zu bytes)\n", len/2);
|
|
return 0;
|
|
} |