feat: Add libcbv2g_json_wrapper core + AppHandshake converter#57
Open
biubiuzhang wants to merge 3 commits intoEVerest:everestfrom
Open
feat: Add libcbv2g_json_wrapper core + AppHandshake converter#57biubiuzhang wants to merge 3 commits intoEVerest:everestfrom
biubiuzhang wants to merge 3 commits intoEVerest:everestfrom
Conversation
36f59be to
1a3b6f6
Compare
Author
|
This PR is part of the approach described in the RFC: #58. Feedback on the architecture and API design is welcome before we submit the remaining protocol converters. |
df6e945 to
3506a01
Compare
Add a native C shared library (libcbv2g_json_wrapper) that provides a JSON-based API for EXI encoding/decoding via libcbv2g. This replaces the Java-based EXIficient codec dependency for EV simulation, eliminating the JRE requirement for embedded/Yocto deployments. This initial PR establishes the architecture and includes: - cbv2g_json_wrapper.h: Public API with error codes and namespace constants - cbv2g_json_wrapper.c: Dispatch logic, version/error functions - json_utils.c/.h: Shared JSON helper utilities (base64, hex, accessors) - apphand_converter.c: AppHandshake (SAP) protocol converter - converters.h: Internal converter declarations - CMakeLists.txt: Build system supporting both system-installed libcbv2g (Yocto) and source-tree builds - Bundled cJSON 1.7.19 (MIT license) in third_party/ The AppHandshake converter is included as the smallest protocol to validate the approach. DIN 70121, ISO 15118-2, and ISO 15118-20 converters will follow in subsequent PRs. Refs: EVerest/EVerest#118, EcoG-io#157, everest-demo#129 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Nancy Zhang <nancy.zhang@enteligent.com>
…rminated strings (CWE-126) Replace strlen/strcmp with strnlen/strncmp across cbv2g_wrapper to address Codacy static analysis findings. No behavioral change for valid null-terminated input. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Nancy Zhang <nancy.zhang@enteligent.com>
…dacy findings (CWE-120, CWE-126) Use snprintf with %s and %.*s for all string copies in apphand_converter to eliminate Codacy warnings about unbounded copies, MS-banned functions, and non-null-terminated string handling. No behavioral change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Nancy Zhang <nancy.zhang@enteligent.com>
0ee4fcc to
85dd0d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a native C shared library (
libcbv2g_json_wrapper) that wraps libcbv2g with a JSON-based API for EXI encoding/decoding, designed to replace the Java-based EXIficient codec in Josev's EV simulation stack.This is the first of 5 PRs to upstream the native EXI codec — it establishes the architecture with the smallest protocol (AppHandshake) for early review and feedback.
Developed by the Enteligent Team.
Problem
The current EV-side simulation (PyEvJosev) depends on a closed-source Java JAR (
ExiCodec.jar) for EXI encoding/decoding, which:What's included (PR 1 of 5)
Upcoming PRs
Build & Test
```bash
With system-installed libcbv2g (e.g., Yocto)
cmake -S iso15118/shared/cbv2g_wrapper -B build
cmake --build build
With libcbv2g source tree
cmake -S iso15118/shared/cbv2g_wrapper -B build -DLIBCBV2G_ROOT=/path/to/libcbv2g
cmake --build build
```
Test plan
🤖 Generated with Claude Code