NPD Documentation¶
NPD is a TTC payload format usual encapsulated in UDP payloads. It is commonly known as DARv3
This module supports the creating and analysis of NPD packets
In typical use, a UDP payload is captured from the network or read from a PCAP file. This is then passed to the
NPD.unpack() method which converts it into an NPD packet
NPD packets consists of NPD Segments which are handled by NPDSegment
Examples and details are available below
NPD Objects¶
- class AcraNetwork.NPD.NPD¶
Class to pack and unpack NPD payloads. The segments will be unpacked for specific defined segements
For unknown data types, the class
NPDSegmentwill be used>>> from base64 import b64decode >>> import AcraNetwork.iNetX as inetx >>> data = b64decode('NVAADAMEAAoAAAAB6wAAAQAAAAUAAAADAA0AAQhAAAAA////AAAAAwAMAAEIQQEA') >>> n = NPD() >>> n.unpack(data) True >>> print(f"{n.datatype:#0X}") 0X50 >>> for segment in n.segments: ... print(f"{segment}") RS232 NPD Segment. TimeDelta=3 Segment Len=13 ErrorCode=0X0 Flags=0X1 Block_Status=0X840 DataLen=3 RS232 NPD Segment. TimeDelta=3 Segment Len=12 ErrorCode=0X0 Flags=0X1 Block_Status=0X841 DataLen=1
- pack() bytes¶
Pack the NPD object into a binary buffer
- unpack(buffer: bytes) bool¶
Unpack a string buffer into an NPD object
- Parameters:
buffer (bytes) – A string buffer representing an NPD packet
- Return type:
None
- segments: List[NPDSegment | ACQSegment | PCMPacketizer | RS232Segment | MIL1553Segment]¶
List of all the data segments
- timestamp¶
The content of this field is based upon the R bit in the flags field of the NPD Packet Protocol header.
NPDSegment Objects¶
- class AcraNetwork.NPD.NPDSegment¶
NPD Payloads are split into segments. This class will pack and unpack segments
- unpack(buffer: bytes) bytes¶
Unpack a string buffer into an NPD segment. Return the remaining buffer so that the next segment can iteratively be unpacked
- property payload: bytes¶
Payload of segment :return:
ACQSegment Objects¶
PCMPacketizer Objects¶
- class AcraNetwork.NPD.PCMPacketizer¶
PCM Packetizer Segments for the ADAU PCM module
A429Segment Objects¶
- class AcraNetwork.NPD.A429Segment¶