Open-Agriculture / AgIsoStack-plus-plus

AgIsoStack++ is the completely free open-source C++ ISOBUS library for everyone
https://agisostack.com/
MIT License
187 stars 41 forks source link

Abyl/custom length #434

Closed abylikhsanov closed 7 months ago

abylikhsanov commented 7 months ago

Describe your changes

Sometimes you want to extract a custom length bit message which can be non divisible by 8 or placed in the middle of data payload. This is my initial work toward decoding the messages according to j1939DA where 1 PGN could actually have several SPNs located at different bit positions and sometimes can have irregular length

How has this been tested?

Have written unit test that should cover cases:

  1. Bit starts at non 0 index of data payload and the length of bits is divisible by 8
  2. Same as 1 but not divisible by 8
  3. Bit starts at non 0 index and its length is less than 8
abylikhsanov commented 7 months ago

@ad3154 All comments have been resolved