diff --git a/applications/flight/lib/radio_utils/__init__.py b/applications/flight/lib/radio_utils/__init__.py index 4379b315..74d85338 100644 --- a/applications/flight/lib/radio_utils/__init__.py +++ b/applications/flight/lib/radio_utils/__init__.py @@ -1,2 +1,2 @@ MAX_PACKET_LEN = 240 -PACKET_DATA_LEN = MAX_PACKET_LEN - 1 +PACKET_DATA_LEN = MAX_PACKET_LEN - 2 diff --git a/applications/flight/lib/radio_utils/image_message.py b/applications/flight/lib/radio_utils/image_message.py index a56828f2..9eabeb77 100644 --- a/applications/flight/lib/radio_utils/image_message.py +++ b/applications/flight/lib/radio_utils/image_message.py @@ -44,6 +44,7 @@ def __init__(self, filepath: str) -> None: self.found_scan = False self.file_err = False self.scan_size = ((self.packet_size - 1) // 64) * 64 + self.count = 0 self.priority = 2 def packet(self) -> bool: @@ -94,11 +95,15 @@ def packet(self) -> bool: else: """mid packet""" packet[0] = IMAGE_MID + packet[1] = self.count + packet[2:] = data - packet[1:] = data + # update cursor and count + self.cursor += self.sent_packet_len - 1 + self.count += 1 - # always needs an ack for these packets - return packet, True + # no longer using Acks for image packets + return packet, False def done(self) -> bool: return (self.length <= self.cursor) or self.file_err @@ -110,7 +115,8 @@ def ack(self) -> None: if self.found_scan: self.in_scan = True # cursor moves by packet len minus the 1 byte header - self.cursor += self.sent_packet_len - 1 + # self.cursor += self.sent_packet_len - 1 + # self.count += 1 def __repr__(self) -> str: return f'