Coder Social home page Coder Social logo

MessageHeaderType SessionID about cbexigen HOT 2 CLOSED

everest avatar everest commented on September 3, 2024
MessageHeaderType SessionID

from cbexigen.

Comments (2)

barsnick avatar barsnick commented on September 3, 2024

Good observation.

OpenV2G does not handle this particular case in the same manner, because this restriction on SessionID was introduced with ISO 15118-20. Yet indeed ISO -2 also has one such restriction, namely genChallengeType (PaymentDetailsRes->GenChallenge), where both OpenV2G and cbV2G create the bytesLen. ISO -20 adds several more types restricted in such a manner.

To successfully decode a stream which does not conform to the schema (by deviation of length), we would need to keep the bytesLen variable available - or introduce an error for an incorrect length. From the encoding point, keeping the "obsolete" variable would put the responsibility on the user to use it correctly.

The discussion would be whether we keep this flexibility (also for e.g. decoding non-conforming streams), or drop it with the variable, and introduce enforcements. Consider that, in the C world, both encoding and decoding use the same structs as API. In C++, you could consider restricting access in the encoder, and being tolerant in the decoder (with e.g. an error code class indicating a deviation, but not failure to decode the message).

from cbexigen.

a-w50 avatar a-w50 commented on September 3, 2024

Thanks for your comments,

I wasn't aware, that this changed from -2 to -20. Anyway, for compatibility reason, it should properly stay as it is for decoding. For encoding, the fixed length could be enforced, though.

Best,
Anton

from cbexigen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.