EVerest / EVerest/cbexigen

Abstract elements should (optionally) not be encoded or decoded

Open
#101 1 comment 0 reactions 0 assignees View on GitHub
bug enhancement
Dominant language
Python
Stars
69
Forks
36
Avg merge
3h 30m
Merged PRs (30d)
1

Description

### 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.