P1sec / pycrate

A Python library to ease the development of encoders and decoders for various protocols and file formats; contains ASN.1 and CSN.1 compilers.
GNU Lesser General Public License v2.1
381 stars 132 forks source link

OER/COER implementation #110

Closed JNevrly closed 3 years ago

JNevrly commented 4 years ago

This is a support for OER/COER codec as defined in ITU-T X.696 (08/2015). Covers the specification EXCEPT sections:

Notes

Testing

TODO's

p1-bmu commented 3 years ago

I started to review the PR: this looks good. Thank you very much for your efforts !

Here are few questions:

As the code is well constructed and independent from the rest, I have merged it: this will enable to continue working on fixes and more support around this OER codec and the specs that make use of it.

JNevrly commented 3 years ago

Thanks for the merge!

  • I've seen you introduced new functions in pycrate_core/utils_py3.py related to REAL OER encoding / decoding. Does it mean it is not intended to work with Python 2.7 (at least for REAL object) ?

No, I just haven't understood the utils* structure. There is no Python3-related code in those utilities, I suppose it should go to utils.py. I'll do a PR with fix for that. However, although I have tried to avoid constructs that would not work in Python2.7, I have not tested it in Python2.7. I'll try to check it.

  • In some case, you are calling the PER codec (at least for BOOL): is it intended to be the aligned or unaligned variant ?

IIRC the only place I called PER functions is in the NULL object and that should be alignment-independent, if I understood that correctly. If I did call it in some situation where it is alignment-related, please let me know.