Skip to content

Commit

Permalink
Merge pull request #43 from us-irs/minor-nak-pdu-improvements
Browse files Browse the repository at this point in the history
minor improvement for NAK PDU
  • Loading branch information
robamu authored Oct 8, 2023
2 parents bd1f145 + 5fe2af4 commit 29e6209
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spacepackets/cfdp/pdu/nak.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _calculate_directive_field_len(self):
self.pdu_file_directive.directive_param_field_len = directive_param_field_len

@property
def segment_requests(self):
def segment_requests(self) -> List[Tuple[int, int]]:
"""An optional list of segment request pair tuples, where the first entry of
list element is the start offset and the second entry is the end offset. If the
start and end offset are both 0, the metadata is re-requested.
Expand All @@ -94,10 +94,10 @@ def segment_requests(self):
def segment_requests(self, segment_requests: Optional[List[Tuple[int, int]]]):
"""Update the segment requests. This changes the length of the packet when packed as well
which is handled by this function."""
self._segment_requests = segment_requests
if self._segment_requests is None:
if segment_requests is None:
self._segment_requests = []
return
else:
self._segment_requests: List[Tuple[int, int]] = segment_requests # type: ignore
self._calculate_directive_field_len()

def pack(self) -> bytearray:
Expand Down

0 comments on commit 29e6209

Please sign in to comment.