Skip to content

PDUProcessor

huggins edited this page May 10, 2023 · 1 revision

PDU Processor

A class to handle receiving PDUs and triggers the appropriate events

class PDUProcessor 
	: PDUProcessorInterface

Includes

Back to Top


Members

Access Type Name Description
Private readonly MessageDelegate _pduDelegate The message delegate that gets called when a new UDP packet is received.
Private readonly ConcurrentQueue<Pdu> _pduMessageQueue The message queue that contains new UDP packets.

Back to Top


Constructors

Access Name Description
Public PDUProcessor(MessageDelegate pduDelegate) Constructor that takes in the Message Delegate to call when a new UDP packet is received.

Functions

Access Return Name Description
Public void CheckForUpdate() Function that checks the _pduMessageQueue for new UDP messages.
Public void OnUDPPacketReceived(byte[] bytes, UDPReceiverMulti.UDPReceiverMulti udpReceiverMulti) Called when a new UDP packet is received.

Back to Top


Details

_pduDelegate

private readonly MessageDelegate _pduDelegate

The message delegate that gets called when a new UDP packet is received.

Back to Top


_pduMessageQueue

private readonly ConcurrentQueue<Pdu> _pduMessageQueue

The message queue that contains new UDP packets.

Back to Top


PDUProcessor

public PDUProcessor
(
	MessageDelegate pduDelegate
)

Constructor that takes in the Message Delegate to call when a new UDP packet is received.

Parameter Description
pduDelegate The message delegate that should get called when a new UDP packet is received.

Back to Top


CheckForUpdate

public void CheckForUpdate()

Function that checks the _pduMessageQueue for new UDP messages.

Back to Top


OnUDPPacketReceived

public void OnUDPPacketReceived
(
	byte[] receivedBytes,
	UDPReceiverMulti.UDPReceiverMulti udpReceiverMulti
)

Called when a new UDP packet is received.

Parameter Description
receivedBytes The contents of the UDP packet represented as a byte array.
udpReceiverMulti The UDPReceiveMulti that received the UDP packet.

Back to Top