Sequence Count Module

This module provides generic sequence counter abstractions and implementation which are commonly needed when working with space packet protocols.

class spacepackets.seqcount.CcsdsFileSeqCountProvider(file_name: Path = PosixPath('seqcnt.txt'))

Bases: FileSeqCountProvider

class spacepackets.seqcount.FileSeqCountProvider(max_bit_width: int, file_name: Path = PosixPath('seqcnt.txt'))

Bases: ProvidesSeqCount

Sequence count provider which uses a disk file to store the current sequence count in a non-volatile way. The first call with the next built-in or using the base class current() call will yield a 0

check_count(line: str) int
create_new() None
current() int
get_and_increment() int

Contract: Retrieve the current sequence count and then increment it. The first call should yield 0

property max_bit_width: int
class spacepackets.seqcount.ProvidesSeqCount

Bases: ABC

abstract get_and_increment() int

Contract: Retrieve the current sequence count and then increment it. The first call should yield 0

abstract property max_bit_width: int
spacepackets.seqcount.PusFileSeqCountProvider

alias of CcsdsFileSeqCountProvider

class spacepackets.seqcount.SeqCountProvider(bit_width: int)

Bases: ProvidesSeqCount

get_and_increment() int

Contract: Retrieve the current sequence count and then increment it. The first call should yield 0

property max_bit_width: int