Skip to content

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

@barsnick

Description

@barsnick

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions