Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions opendis/dis7.py
Original file line number Diff line number Diff line change
Expand Up @@ -3787,23 +3787,23 @@ def serialize(self, outputStream):
outputStream.write_unsigned_int(self.variableDatumID)
outputStream.write_unsigned_int(self.variableDatumLength)
for x in range(self.variableDatumLength // 8): # length is in bits
outputStream.write_byte(self.variableData[x])
outputStream.write_unsigned_byte(self.variableData[x])

#send padding
for x in range(self.datumPaddingSizeInBits() // 8):
outputStream.write_byte(0)
outputStream.write_unsigned_byte(0)

def parse(self, inputStream):
"""Parse a message. This may recursively call embedded objects."""
self.variableDatumID = inputStream.read_unsigned_int()
self.variableDatumLength = inputStream.read_unsigned_int()
for x in range(self.variableDatumLength // 8): # length is in bits
self.variableData.append(inputStream.read_byte())
self.variableData.append(inputStream.read_unsigned_byte())

# Skip over padding
# "This field shall be padded at the end to make the length a multiple of 64-bits."
for x in range(self.datumPaddingSizeInBits() // 8):
inputStream.read_byte()
inputStream.read_unsigned_byte()


class EventIdentifierLiveEntity:
Expand Down Expand Up @@ -7447,10 +7447,10 @@ def serialize(self, outputStream):
outputStream.write_unsigned_short(self.encodingScheme)
outputStream.write_unsigned_short(self.tdlType)
outputStream.write_unsigned_int(self.sampleRate)
outputStream.write_short(len(self.data) * 8)
outputStream.write_short(self.samples)
outputStream.write_unsigned_short(len(self.data) * 8)
outputStream.write_unsigned_short(self.samples)
for b in self.data:
outputStream.write_byte(b)
outputStream.write_unsigned_byte(b)

def parse(self, inputStream):
"""Parse a message. This may recursively call embedded objects."""
Expand All @@ -7460,10 +7460,10 @@ def parse(self, inputStream):
self.encodingScheme = inputStream.read_unsigned_short()
self.tdlType = inputStream.read_unsigned_short()
self.sampleRate = inputStream.read_unsigned_int()
self.dataLength = inputStream.read_short()
self.samples = inputStream.read_short()
self.dataLength = inputStream.read_unsigned_short()
self.samples = inputStream.read_unsigned_short()
for idx in range(0, self.dataLength // 8):
element = inputStream.read_byte()
element = inputStream.read_unsigned_byte()
self.data.append(element)


Expand Down