I would even go that far and always use bit positions and only use byte 
positions for box rendering and as utility method. Also making the type more 
explicit in the name is a good idea I think.

- Sebastian

On 2025/09/16 19:40:32 Christofer Dutz wrote:
> Hi all,
> 
> Just came back from Minneapolis this morning and was continuing my work on 
> cleaning up PLC4X. Here I noticed one thing, that could cause problems.
> 
> It seems that „curPos“ in mspec refers to the byte-position in the 
> byte-buffer. This has never caused issues before, but I know there are 
> protocols out there, that have non byte aligned complex objects. I think in 
> firmata there were types that were only 4 bits long.
> 
> By sticking to the bytePosition, we will have issues modeling such protocols 
> fully.
> 
> If however, we updated our mspecs to expect curPos to be a bit-position, we 
> would avoid this type of problem.
> 
> What do you think? Should we update this? I also think that it might be 
> beneficial to be a bit more explicit. We could add a „curBitPos“ and rename 
> the existing „curBytePos“ for compatability reasons.
> 
> Chris
> 

Reply via email to