SamDec008 Documentation¶
This is a class to handle the SAM/DEC/008 USB PCM decommutator. Once programmed this will capture ethernet packets from the SAM/DEC/008, align the to the sync word and return them as PCM frames
SamDec008 Objects¶
- class AcraNetwork.SamDec008.SamDec008(udp_port: int, timeout: float = 5.0, localaddress='')¶
The SAM/DEC/008 is a USB power PCM decommutator (https://www.curtisswrightds.com/products/flight-test/ground-stations/samdec008)
Once configured it will convert PCM frames into iNetX packets over UDP
This class will capture UDP packets from the network, extract the iNetX payload and align the data to PCM frame boundaries. It will return PCM frames as bytes
Supply the UDP port and the IP Address of the correct network interface card on your PC You can use ‘’ to let you OS decide
- Parameters:
>>> samdec = SamDec008(8010, localaddress="127.0.0.1", timeout=0.5) >>> for frame in samdec.frames(): ... (syncword, sfid, word1) = struct.unpack_from(">IHH", frame)
- frames() Generator[bytes, None, None]¶
Get the data from the underlying source, combine the IP fragments and then pull out the payload from the inetx packets and align them
- Yields:
bytes: the payload captured
- frame_length¶
This will be populated when seraching for frame sync words
- streamid¶
StreamID on which to capture the SAM/DEC data. Default of 0x153 should be ok
- sync_word¶
The Frame sync word.
SamDecPcap Objects¶
- class AcraNetwork.SamDec008.SamDecPcap(pcap_fname: str)¶
The SAM/DEC/008 is a USB power PCM decommutator (https://www.curtisswrightds.com/products/flight-test/ground-stations/samdec008)
Once configured it will convert PCM frames into iNetX packets over UDP
This class will take iNetx packet fromn a pcap file, extract the iNetX payload and align the data to PCM frame boundaries. It will return PCM frames as bytes
- Parameters:
pcap_fname (str) – The PCAP filename
>>> samdec = SamDecPcap("test/sample_pcap/samdec.pcap") >>> for frame in samdec.frames(): ... (syncword, sfid, word1) = struct.unpack_from(">IHH", frame) ... print(f"SW={syncword:#0X} sfid={sfid}") SW=0XFE6B2840 sfid=4 SW=0XFE6B2840 sfid=5 SW=0XFE6B2840 sfid=6 SW=0XFE6B2840 sfid=7
- frame_length¶
This will be populated when seraching for frame sync words
- streamid¶
StreamID on which to capture the SAM/DEC data. Default of 0x153 should be ok
- sync_word¶
The Frame sync word.