Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rumpelsepp committed Jul 8, 2024
1 parent d57390c commit 81292d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gallia/transports/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,16 @@ async def read(self, timeout: float | None = None, tags: list[str] | None = None
time_left_ms = max(0, int(time_left * 1000))

await asyncio.to_thread(
canlib.WaitForSingleObject, self.event_handle.value, time_left_ms
canlib.WaitForSingleObject,
self.event_handle.value,
time_left_ms,
)

event = vector_ctypes.XLfrEvent()
vector_ctypes.xlFrReceive(self.port_handle, ctypes.byref(event))

print(event)
print(event.tagData)

# TODO: slicing is correct?
return bytes(event.tagData.raw)[: int(event.size)]
Expand Down

0 comments on commit 81292d7

Please sign in to comment.