Wrong size/type of beamDataLength attribute in the AcousticBeamData class (DIS 6 and DIS 7)
Closed this issue · 4 comments
The size of the buffer data for the beamDataLength
attribute in the AcousticBeamData
class has to be 8 bit and the type can be short
like beamIDNumber
- the next attribute of the class. Currently beamDataLength
has 16 bit and casted to int
:
marshalSize = marshalSize + 2; // beamDataLength
beamDataLength = (int) (buff.getShort() & 0xFFFF);
In this case the buffer will be underflown while reading UA PDUs (UaPdu
) which is containing a AcousticEmitterSystemData
list which is containing a list with AcousticBeamData
objects.
Of course, I proofed this in the DIS Document: IEEE Std 1278.1a-1998
This is a fairly simple problem and I would appreciate a solution soon. Thanks and best regards!
Thank-you for the report @Eihof
The quickest way to fix this is if you're able to submit a pull request with the change. And ideally with a unit test. I will review and merge it. Are you able to do that?
I could do this but it seems like I don't have the permissions to create a branch.
Maybe I can do this from a branch of a fork. I will try...
Now I think I will be able to submit a pull request. For the unit test I wil need the .raw file for the UaPdu
.
I couldn't find any unit tests for UaPdu
and any raw files for DIS 6.