Skip to content

Commit

Permalink
MRG: Merge pull request #49 from aerosense-ai/fix/update-handles-in-p…
Browse files Browse the repository at this point in the history
…araser-process

Update handles in parser process instead of reader process
  • Loading branch information
time-trader authored Mar 30, 2022
2 parents cf3fcf4 + 9e1cc8f commit 0868390
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions data_gateway/packet_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ def read_packets(self, serial_port, packet_queue, stop_signal):
length = int.from_bytes(serial_port.read(), self.config.endian)
packet = serial_port.read(length)

if packet_type == str(self.config.type_handle_def):
self.update_handles(packet)
continue

# Check for bytes in serial input buffer. A full buffer results in overflow.
if serial_port.in_waiting == self.config.serial_buffer_rx_size:
logger.warning("Serial port buffer is full - buffer overflow may occur, resulting in data loss.")
Expand Down Expand Up @@ -169,6 +165,10 @@ def parse_packets(self, packet_queue, stop_signal, stop_when_no_more_data_after=
break
continue

if packet_type == str(self.config.type_handle_def):
self.update_handles(packet)
continue

if packet_type not in self.handles:
logger.error("Received packet with unknown type: %s", packet_type)
continue
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="data_gateway",
version="0.11.5",
version="0.11.6",
install_requires=[
"click>=7.1.2",
"pyserial==3.5",
Expand Down

0 comments on commit 0868390

Please sign in to comment.