Skip to content

Commit

Permalink
Add comment on GreedyBytes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Diamond committed Apr 10, 2024
1 parent 715843d commit 64a0126
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def pack(self, buffer: bytes = None, offset: int = 0, return_buffer: bool = True
return PackedDataToBuffer(packed_data, buffer, offset, return_buffer)

def unpack(self, buffer: bytes, offset: int = 0, message_version: int = MessagePayload._UNSPECIFIED_VERSION) -> int:
# NOTE: Since this message does no capture the expected data size, the Construct relies on the size of the Python
# `buffer` to infer the size of the data. This is the behavior of @ref GreedyBytes.
parsed = self.DataWrapperMessageConstruct.parse(buffer[offset:])
self.unpack_timestamp(parsed.time_stamp_data)
self.data_type = parsed.data_type
Expand Down

0 comments on commit 64a0126

Please sign in to comment.