Closed timpokorny closed 1 year ago
Hey Tim, I’m still not sure that fix is 100% standard compliant (it looks like it never was). The standard talks about the Beam Data Length
field being
BeamData
member in our case)However from what I can see our code is treating it as
EmitterBeam
componentSo line 143 needs to be changed from:
int beamLength = getByteLength();
to
int beamDataLength = beamData.getByteLength() / 4; // Size of the beam data in 32-bit words
@michaelrfraser - I concur. I have updated the encoding for both this instance, in EmitterBeam
, and for the same problem in EmitterSystem
. Updated in commit https://github.com/openlvc/disco/commit/9de56e9b72b7eddcf580f619249cc6d2e4985f0f
DIS 7 Spec (7.6.2 paragraph f.5.i) says that for an emitter beam, if the length of the beam is greater than 255, write it as 0.
I checked that the length for this record isn't being used anywhere in deserialization (we go by the number of records, which is also written to the record in the PDU), so this shouldn't have an advserse impact.