diff --git a/create_test3.c b/create_test3.c deleted file mode 100644 index df2a60e..0000000 --- a/create_test3.c +++ /dev/null @@ -1,76 +0,0 @@ -#include -#include -#include -#include - -int hex_char_to_int(char c) { - if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'A' && c <= 'F') return c - 'A' + 10; - if (c >= 'a' && c <= 'f') return c - 'a' + 10; - return -1; -} - -int main() { - const char* hex_string = "8098021050908C0C0C0E0C50E00000002040C40C203030C01400003103D00C0618370105088270095A5A30303030300008"; - - size_t hex_len = strlen(hex_string); - if (hex_len % 2 != 0) { - printf("Error: Hex string length must be even\n"); - return -1; - } - - size_t binary_len = hex_len / 2; - unsigned char* binary_data = malloc(binary_len); - - if (!binary_data) { - printf("Memory allocation failed\n"); - return -1; - } - - // Convert hex string to binary - for (size_t i = 0; i < binary_len; i++) { - int high = hex_char_to_int(hex_string[i * 2]); - int low = hex_char_to_int(hex_string[i * 2 + 1]); - - if (high == -1 || low == -1) { - printf("Invalid hex character at position %zu\n", i * 2); - free(binary_data); - return -1; - } - - binary_data[i] = (high << 4) | low; - } - - // Write to file - FILE* file = fopen("test3.exi", "wb"); - if (!file) { - printf("Cannot create output file\n"); - free(binary_data); - return -1; - } - - size_t written = fwrite(binary_data, 1, binary_len, file); - fclose(file); - free(binary_data); - - if (written != binary_len) { - printf("Write error\n"); - return -1; - } - - printf("Successfully created test3.exi with %zu bytes\n", binary_len); - - // Show first few bytes for verification - printf("First 16 bytes: "); - FILE* verify = fopen("test3.exi", "rb"); - if (verify) { - for (int i = 0; i < 16 && i < binary_len; i++) { - int c = fgetc(verify); - printf("%02X ", c); - } - fclose(verify); - } - printf("\n"); - - return 0; -} \ No newline at end of file diff --git a/create_test3.exe b/create_test3.exe deleted file mode 100644 index cc411f8..0000000 Binary files a/create_test3.exe and /dev/null differ diff --git a/create_test4.c b/create_test4.c deleted file mode 100644 index 0ca4ffa..0000000 --- a/create_test4.c +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include -#include - -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; -} \ No newline at end of file diff --git a/create_test4.exe b/create_test4.exe deleted file mode 100644 index 2efc1f7..0000000 Binary files a/create_test4.exe and /dev/null differ diff --git a/create_test_exi.c b/create_test_exi.c deleted file mode 100644 index aa53916..0000000 --- a/create_test_exi.c +++ /dev/null @@ -1,66 +0,0 @@ -#include -#include -#include - -/* EXI codec headers */ -#include "iso1EXIDatatypes.h" -#include "iso1EXIDatatypesEncoder.h" -#include "ByteStream.h" - -#define BUFFER_SIZE 1024 - -int main() { - struct iso1EXIDocument exiDoc; - bitstream_t stream; - uint8_t buffer[BUFFER_SIZE]; - size_t pos = 0; - int errn = 0; - - /* Initialize EXI document */ - init_iso1EXIDocument(&exiDoc); - - /* Create a simple V2G message */ - exiDoc.V2G_Message_isUsed = 1; - init_iso1MessageHeaderType(&exiDoc.V2G_Message.Header); - - /* Set session ID to all zeros */ - memset(exiDoc.V2G_Message.Header.SessionID.bytes, 0, 8); - exiDoc.V2G_Message.Header.SessionID.bytesLen = 8; - - /* Create session setup request */ - exiDoc.V2G_Message.Body.SessionSetupReq_isUsed = 1; - init_iso1SessionSetupReqType(&exiDoc.V2G_Message.Body.SessionSetupReq); - - /* Set EVCC ID */ - strcpy((char*)exiDoc.V2G_Message.Body.SessionSetupReq.EVCCID.bytes, "01"); - exiDoc.V2G_Message.Body.SessionSetupReq.EVCCID.bytesLen = 2; - - /* Setup output stream */ - stream.size = BUFFER_SIZE; - stream.data = buffer; - stream.pos = &pos; - stream.buffer = 0; - stream.capacity = 8; - - /* Encode to EXI */ - printf("Encoding V2G message to EXI...\n"); - errn = encode_iso1ExiDocument(&stream, &exiDoc); - - if (errn != 0) { - printf("Encoding failed with error: %d\n", errn); - return -1; - } - - /* Write to file */ - FILE *fp = fopen("test_message.exi", "wb"); - if (fp == NULL) { - printf("Cannot create output file\n"); - return -1; - } - - fwrite(buffer, 1, pos, fp); - fclose(fp); - - printf("Created test_message.exi with %zu bytes\n", pos); - return 0; -} \ No newline at end of file diff --git a/create_test_exi.exe b/create_test_exi.exe deleted file mode 100644 index 97fe278..0000000 Binary files a/create_test_exi.exe and /dev/null differ diff --git a/enhanced_exi_viewer.exe b/enhanced_exi_viewer.exe index 2bd5906..f183553 100644 Binary files a/enhanced_exi_viewer.exe and b/enhanced_exi_viewer.exe differ diff --git a/test1.exi b/test1.exi new file mode 100644 index 0000000..9350a63 Binary files /dev/null and b/test1.exi differ diff --git a/test2.exi b/test2.exi new file mode 100644 index 0000000..4748cb5 Binary files /dev/null and b/test2.exi differ diff --git a/test3.exi b/test3.exi new file mode 100644 index 0000000..0cacbcf Binary files /dev/null and b/test3.exi differ diff --git a/test4.xml b/test4.xml deleted file mode 100644 index 4ad57bf..0000000 --- a/test4.xml +++ /dev/null @@ -1,53 +0,0 @@ - - -
- 4142423030303831 -
- - - - true - 0 - 100 - - - 0 - 3 - 5 - - - 0 - 4 - 460 - - - 0 - 4 - 471 - - - 0 - 3 - 100 - - - 3 - 5 - 50 - - false - true - - 0 - 2 - 0 - - - 0 - 2 - 0 - - - -
diff --git a/test4_converted.exi b/test4_converted.exi deleted file mode 100644 index 7b82a14..0000000 --- a/test4_converted.exi +++ /dev/null @@ -1 +0,0 @@ -Error encoding to EXI (error: -109) diff --git a/test5.xml b/test5.xml deleted file mode 100644 index 9e13340..0000000 --- a/test5.xml +++ /dev/null @@ -1,3 +0,0 @@ - - -4142423030303831true01000310446004471031003550falsetrue020020 \ No newline at end of file diff --git a/test5_encoded.exi b/test5_encoded.exi deleted file mode 100644 index b649d9b..0000000 --- a/test5_encoded.exi +++ /dev/null @@ -1 +0,0 @@ -Error encoding to EXI (error: -109)\n \ No newline at end of file diff --git a/test5_final.exi b/test5_final.exi deleted file mode 100644 index 6c77723..0000000 --- a/test5_final.exi +++ /dev/null @@ -1 +0,0 @@ -P  P \ No newline at end of file diff --git a/test5_generated.exi b/test5_generated.exi deleted file mode 100644 index ebbc024..0000000 --- a/test5_generated.exi +++ /dev/null @@ -1,47 +0,0 @@ -DEBUG: Parsing EVTargetCurrent section -DEBUG find_tag_in_section: Looking for 'Multiplier' in section of 137 chars -DEBUG: Found 'Multiplier' = '0' -DEBUG find_tag_in_section: Looking for 'Unit' in section of 137 chars -DEBUG: Found 'Unit' = '3' -DEBUG find_tag_in_section: Looking for 'Value' in section of 137 chars -DEBUG: Found 'Value' = '1' -DEBUG PhysicalValue: mult='0'->0, unit='3'->3, value='1'->1 -DEBUG: Parsing EVTargetVoltage section -DEBUG find_tag_in_section: Looking for 'Multiplier' in section of 139 chars -DEBUG: Found 'Multiplier' = '0' -DEBUG find_tag_in_section: Looking for 'Unit' in section of 139 chars -DEBUG: Found 'Unit' = '4' -DEBUG find_tag_in_section: Looking for 'Value' in section of 139 chars -DEBUG: Found 'Value' = '460' -DEBUG PhysicalValue: mult='0'->0, unit='4'->4, value='460'->460 -DEBUG find_tag_in_section: Looking for 'Multiplier' in section of 145 chars -DEBUG: Found 'Multiplier' = '0' -DEBUG find_tag_in_section: Looking for 'Unit' in section of 145 chars -DEBUG: Found 'Unit' = '4' -DEBUG find_tag_in_section: Looking for 'Value' in section of 145 chars -DEBUG: Found 'Value' = '471' -DEBUG PhysicalValue: mult='0'->0, unit='4'->4, value='471'->471 -DEBUG find_tag_in_section: Looking for 'Multiplier' in section of 145 chars -DEBUG: Found 'Multiplier' = '0' -DEBUG find_tag_in_section: Looking for 'Unit' in section of 145 chars -DEBUG: Found 'Unit' = '3' -DEBUG find_tag_in_section: Looking for 'Value' in section of 145 chars -DEBUG: Found 'Value' = '100' -DEBUG PhysicalValue: mult='0'->0, unit='3'->3, value='100'->100 -DEBUG find_tag_in_section: Looking for 'Multiplier' in section of 142 chars -DEBUG: Found 'Multiplier' = '3' -DEBUG find_tag_in_section: Looking for 'Unit' in section of 142 chars -DEBUG: Found 'Unit' = '5' -DEBUG find_tag_in_section: Looking for 'Value' in section of 142 chars -DEBUG: Found 'Value' = '50' -DEBUG PhysicalValue: mult='3'->3, unit='5'->5, value='50'->50 -DEBUG: Parsed V2G Message: - V2G_Message_isUsed: 1 - CurrentDemandReq_isUsed: 1 - EVReady: 1 - EVErrorCode: 0 - EVRESSSOC: 100 - EVTargetCurrent: 1 (Mult: 0, Unit: 3) - EVTargetVoltage: 460 (Mult: 0, Unit: 4) - ChargingComplete: 1 -P  P \ No newline at end of file