Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract elements should (optionally) not be encoded or decoded #101

Open
barsnick opened this issue Dec 10, 2024 · 1 comment
Open

Abstract elements should (optionally) not be encoded or decoded #101

barsnick opened this issue Dec 10, 2024 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@barsnick
Copy link
Contributor

Describe the bug

The cbV2G API, as created by cbExiGen, allows for access to the non-concrete abstract elements. These are exposed by *_isUsed boolean variables and even have encoders and decoders, but fulfill no real purpose. In the case of encoding, the presence of these particles is basically forbidden, even though technically possible via their event codes.

The encoder code could refuse to encode a message or fragment which contains an *_isUsed for such a particle.

The decoder code could return an error on encountering an event code which represents such a particle (while the presence of the event code itself is important for proper counting),

To Reproduce

No response

Anything else?

This behavior of creating code for returning errors for unsupported abstract elements should be optional, via config.

In the encoder, this code could return an error instead of encoding:
https://github.com/EVerest/libcbv2g/blob/0966194e995cdb741b02547ddd9abd67455691d9/lib/cbv2g/iso_20/iso20_AC_Encoder.c#L15818-L15826

In the decoder, this code could return an error instead of decoding:
https://github.com/EVerest/libcbv2g/blob/0966194e995cdb741b02547ddd9abd67455691d9/lib/cbv2g/iso_20/iso20_AC_Decoder.c#L16617-L16624

New error type #defines should be introduced.

@barsnick barsnick added bug Something isn't working enhancement New feature or request labels Dec 10, 2024
@barsnick
Copy link
Contributor Author

This is the cause for #100 and EVerest/libiso15118#53.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant