esa / CCSDS_MO_TRANS

REPOSITORY ARCHIVED - for the latest version please go to https://github.com/esa/mo-services-java
Other
3 stars 7 forks source link

Refactored the Binary Encoding implementations #37

Closed dmarszk closed 6 years ago

dmarszk commented 6 years ago

This pull request has been created to allow early review of binary encoding refactor. It will be modified with further patches.

This set of changes corrects baseline binary encoding implementations, allowing reuse of them by the transport bindings, thus reducing amount of encoding code within transport binding implementations (most notably SPP, ZMTP, TCPIP).

Outline of the changes:

  1. All binary encoding variants have been merged into a single project, with 4 modules: 1.1. Base Binary Encoding (inherits from GEN encoding) 1.2. Fixed Binary Encoding (inherits from Base) 1.3. Variable Binary Encoding (inherits from Base) 1.4. Split Binary Encoding (inherits from Variable)
  2. Implemented binary encoding time handler (BinaryTimeHandler) class, allowing derived binary encodings to easily override time encoding behaviour. The default time handler implements CDS with P-field assumed to be "01000000" for Time (16-bit days since CCSDS Epoch + 32-bit ms in a day) and "01000010" for FineTime (16-bit days since CCSDS Epoch + 32-bit ms in a day + 32-bit picoseconds in a ms).
  3. Created generic BaseBinaryStreamFactory class, simplifying derived implementations StreamFactory source code [COMMENT NEEDED: I think I might have overengineered this one, given that only Split and Variable encodings are using this mechanisms now]
  4. Implemented optional 16-bit length field encoding in Fixed Binary Encoding, configurable through esa.mo.mal.encoder.binary.fixed.shortLengthField property. This is a deviation from the standard, used in OPS-SAT mission and originally implemented in binary encoder for SPP.
  5. Greatly reduced amount of encoding code in the transport binding implementations, leaving only transport-specific bits (e.g. special time encoding [SPP], or header encoding [ZMTP]) [TODO: Test the changes to SPP]
gbonnefille commented 6 years ago

Please, as the CCSDS_MAL_ENCODING_BINARY was hugely refactored, can you bump the version of the module in the POM? Idem with CCSDS_MAL_TRANSPORT_TCPIP.