diff --git a/satcom/openlst/client_packet_lib.py b/satcom/openlst/client_packet_lib.py index 1347e1c..8f20427 100644 --- a/satcom/openlst/client_packet_lib.py +++ b/satcom/openlst/client_packet_lib.py @@ -15,8 +15,8 @@ class ClientPacketHeader(BaseModel): def err(self): """Throws an error if any params are out of bounds""" - if self.length < 6 or self.length > 251: - return ValueError('length must be 6-251') + if self.length < 7 or self.length > 251: + return ValueError('length must be 7-251') if self.hardware_id < 0 or self.hardware_id > 65535: return ValueError('hardware_id must be 0-65535') if self.sequence_number < 0 or self.sequence_number > 65535: diff --git a/satcom/openlst/space_packet_lib.py b/satcom/openlst/space_packet_lib.py index 792f4fc..a253702 100644 --- a/satcom/openlst/space_packet_lib.py +++ b/satcom/openlst/space_packet_lib.py @@ -19,8 +19,8 @@ class SpacePacketHeader(BaseModel): def err(self): """Throws an error if any params are out of bounds""" - if self.length < 9 or self.length > 251: - return ValueError('length must be 9-251') + if self.length < 10 or self.length > 254: + return ValueError('length must be 10-254') if self.sequence_number < 0 or self.sequence_number > 65535: return ValueError('sequence_number must be 0-65535') if self.destination < 0 or self.destination > 255: diff --git a/satcom/openlst/test_client_packet.py b/satcom/openlst/test_client_packet.py index ae6f897..dc51226 100644 --- a/satcom/openlst/test_client_packet.py +++ b/satcom/openlst/test_client_packet.py @@ -82,5 +82,4 @@ def test_client_packet_from_bytes_empty_frame(self): p = client_pkt_lib.ClientPacket(val) pkt = p.from_bytes(val) - self.assertIsNone(pkt.err(), msg=f'{pkt.header.length}') - self.assertEqual(len(pkt.data), 0, f'expected empty result, got {pkt.data}') + self.assertIsNotNone(pkt.err())