I don't appear to be able to find the way around it however.
An example of the issue is as below:
The bits on the most significant side (001) are from a BitLength=3 field that defines the overall structure of the remainder of the data (only the Logical is shown, there is also Port, Network, Symbolic, Data, DataTypeC, DataTypeE)
As such I'd ideally like to be able to do:
class CipEpath
{
[FieldOrder(0)]
[FieldBitLength(3, BitOrder.MSB)
public CipEpathSegmentType Type;
[FieldOrder(1)]
[SubType(nameof(Type), SipEpathSegmentType.Logical, typeof(CipEpathLogical)]
public CipEpathSegment Segment; <== this would translate the LogicalType into its various subdivisions like
}
class CipEpathLogicalSegment : CipEpathSegment
{
[FieldOrder(0)]
[FieldBitLength(3, BitOrder.MSB)]
public CipEpathLogicalType Type;
...
}
However, the FieldBitLength appears to always be 'sliced' from the Least Significant Bit upwards, rather than the Most Significant Bit downwards.
Hence something like this:
[FieldBitLength(3, BitOrder.MSB)
would be ideal, to reverse this (for specific fields).
I don't think mixing BitOrder.MSB and BitOrder.LSB in the same byte would be needed...
I think I've got a problem similar to what is discussed in this issue https://github.com/jefffhaynes/BinarySerializer/issues/106
I don't appear to be able to find the way around it however.
An example of the issue is as below:
The bits on the most significant side (001) are from a BitLength=3 field that defines the overall structure of the remainder of the data (only the Logical is shown, there is also Port, Network, Symbolic, Data, DataTypeC, DataTypeE)
As such I'd ideally like to be able to do:
However, the FieldBitLength appears to always be 'sliced' from the Least Significant Bit upwards, rather than the Most Significant Bit downwards. Hence something like this: [FieldBitLength(3, BitOrder.MSB) would be ideal, to reverse this (for specific fields). I don't think mixing BitOrder.MSB and BitOrder.LSB in the same byte would be needed...