Hello,

I am trying to implement a schema to describe a LINK-16 message
embedded within a DIS Signal PDU as described by SISO-STD-002 [1],
paragraph 5.2.2.9 and table 5.2.3; commonly referred to as SISO-J.
The problem is that fields are packed into 32 bit words with big
endian byte order, and little endian bitfield order.  It is currently
an error to specify a byteOrder of bigEndian with a bitOrder of
leastSignificantBitFirst.  Also, I have not found a way to set word
size; it appears that word size is implicitly set to the size of each
field.

Following is a simple example to demonstrate how fields need to be
interpreted.  It is just an example and does not represent any part of
a SISO-J message.

Data is comprised of 3 unsigned integer bitfields:
slot1 is 12 bits
slot2 is 32 bits
slot3 is 20 bits

Given an input with the following bytes in hex:
01 23 45 67 89 AB CD EF

Parsed results need to be (in hex):
slot1: 0567
slot2: DEF01234
slot3: 089ABC

Explanation of results:

Since the bitfields need to consume data in a leastSignificantBitFirst
order, it is easier to represent the input in right-to-left order
where bits are consumed starting at the right and moving toward the
left.  Since words are 4 bytes, and in big endian order, the lowest
bit in the 4th byte is the first bit to be consumed.  Reordering the
input data and consuming data from right to left yields the correct
field boundaries.

89 AB CD EF 01 23 45 67      parse fields right to left
05 06 07 08 01 02 03 04      input byte position

slot1 consumes the right 3 nibbles, slot2 consumes the next 8 nibbles,
and slot3 consumes the left 5 nibbles.

Could you please let me know if there is a way to parse fields in this manner?



Marshall Miller


[1] 
https://www.sisostds.org/DesktopModules/Bring2mind/DMX/Download.aspx?Command=Core_Download&EntryId=43048&PortalId=0&TabId=105

Reply via email to