open-dis-python icon indicating copy to clipboard operation
open-dis-python copied to clipboard

When serializing, length field is always zero

Open kastork opened this issue 5 years ago • 4 comments

In the dis_sender.py, the emitted ESPDU has its length field set to zero.

The code in that example doesn't manipulate the length field.

This matters if you're using, say, open-dis java's PduFactory#getPdusFromBundle()`, which relies on this field's value.

kastork avatar Mar 30 '20 19:03 kastork

Thank-you for the report @kastork

Setting the length seems like something that should be done automatically by the library.

Can I interest you in submitting a pull request?

leif81 avatar Apr 01 '20 02:04 leif81

I doubt I'll have time to, I'm not really making a python application, was just kicking the tires and learning.

kastork avatar Apr 09 '20 14:04 kastork

Here's an example for how length is calculated in open-dis-java

https://github.com/open-dis/open-dis-java/blob/master/src/main/java/edu/nps/moves/dis/EntityStatePdu.java#L61

leif81 avatar Dec 21 '20 02:12 leif81

Currently working on it. Will file PR within day or two. PS: Also found some crtitcal typos (like when variable initialized as munitionExpendableID and used as munitionExpendibleID)

VovaDev avatar Apr 03 '24 18:04 VovaDev