Closed adamwrobinson5 closed 1 year ago
@adamwrobinson5 are you using PduFactory? If not suggest giving it a try and see if you get the same result.
@leif81 Thanks for the reply! But yeah, I am using the PduFactory. The PduFactory news up a SignalPdu which news up a Chunk. The SignalPdu tries calling initFromBinary
on the Chunk but it fails because that function doesn't exist on the Chunk.
@adamwrobinson5 @leif81 I can get a branch and PR out to fix the first issue, but I haven't looked too much into the second issue. I can confirm that the first issue is impacting some things I'm working on as well, so if possible, I'd like to get it patched up and get a release cut to the NPM registry.
@crhowell3 The v1.3.4 release with this change has been published to NPM, give it a try.
anX.initFromBinary is not a function
. This seems to be becauseinitFromBinary
is not the correct function name.The functions defined on the Chunk object in Chunk.js are
initFromBinaryDIS
andencodeToBinaryDIS
. However, the functions used throughout the repository are justinitFromBinary
andencodeToBinary
.This code snippet comes from inside the SignalPdu:
encodeToBinary
function on the SignalPdu, the linethis.data[idx].encodeToBinary(outputStream)
continues to break becauseencodeToBinary
doesn't exist on the elements insidethis.data
. As far as I can tell,this.data
is just an array of 8 bit values, not specific DIS objects so I'm not sure why we're callingencodeToBinary
on the elements of the array instead of doing something likeoutputStream.writeByte(this.data[idx])
. Can anyone tell me what exactly I should be settingthis.data
to?