| TSharedFromThis
|
Module |
|
Header |
/Engine/Plugins/VirtualProduction/DMX/DMXProtocol/Source/DMXProtocol/Public/Interfaces/IDMXProtocol.h |
Include |
#include "Interfaces/IDMXProtocol.h" |
class IDMXProtocol : public IDMXProtocolBase
Serves as a higher level abstraction of a specific protocol such as Art-Net or sACN with the purpose to hide its complexity.
By that the commonly expected responsability of the implementation is to:
Provide a way to send and receive protocol specific DMX from and to the system.
Push received DXM as generic DMXSignals to the registered DMXInputPorts.
Pull generic DMXSignals from the registered DMXOutputPorts and send it as Protocol specific DMX.
For an overview for DMX and protocol developers, see DMXPortManager (in IO folder) For an exemplary implementation, see DMXProtocolArtNet (in ProtocolArtNetModule)
FOR PROTOCOL DEVELOPERS
Naming Guideline/Terminology
Senders, Receivers Send and Receive Protocol specific DMX. For protocol implementations only, should not be publicly exposed. InputPorts, OutputPorts Send and Receive Protocol agnostic DMX. Listeners Listen to DMX traffic of Ports and input heard DMX into the engine.
DMX Protocol Life-Cycle
Startup:
DMX Protocol Module gets instantiated (Pre-Default).
DMX Protocol Manager gets created
DMX Protocol Settings CDO gets created
Modules that implement actual protocol (e.g. DMXProtocolArtNet) are instantiated.
Each module registeres itself with the Protocol Module via IDMXProtocolModule::RegisterProtocol
The module waits for all protocols being registered
A check is hit if more protocol modules register itself than expected To add a new protocol you need to increase the counter in DMXProtocolModule.
DMX Port Manager gets started
Looks up DMX Protocol Settings instantiates DMX Ports according to the DMX Port Config Arrays
Calls FDMXPort::Initialize on each port right after instantiation.
The DMX Ports register themselves with their protocol by calling IDMXProtocol::RegisterInputPort resp. IDMXProtocol::RegisterOutputPort.
Pass received DMX by calling DMXInputPort::SingleProducerInputDMXSignal on all Input Ports. The Input Ports do the required filtering for relevant data, you don't need to do it.
The protocol needs to return an object that implements IDMXSender for each registered OutputPort.
If an Input Port cannot be registered, e.g. because the network interface is not reachable, the protocol needs to return false.
If an Output Port cannot be registered, e.g. because the network interface is not reachable, the protocol needs to return nullptr. (see DMXProtocolArtNet for an example)
Name | Description | ||
---|---|---|---|
|
IDMXProtocol... |
Get ( |
If protocol exists return the pointer otherwise it create a new protocol first and then return the pointer. |
|
GetFirstProtocolName() |
||
|
const TArray... |
GetInputPortCommunicationTypes() |
Returns the communication types the protocol supports for its input ports. |
|
GetMaxUniverseID() |
Get maximum supported universe ID for protocol |
|
|
GetMinUniverseID() |
Get minimum supported universe ID for protocol |
|
|
const TArray... |
GetOutputPortCommunicationTypes() |
Returns the communication types the protocol supports for its input ports. |
|
const TMap< ... |
GetProtocolFactories() |
~End IDMXProtocol Interface definition |
|
const FName ... |
GetProtocolName() |
Get the Protocol Name |
|
const TArray... |
GetProtocolNames() |
|
|
const TMap< ... |
GetProtocols() |
|
|
IsCausingLoopback ( |
Called to deduce if the communication type will be heard by corresponding input ports. |
|
|
IsEnabled() |
Whether protocol enabled |
|
|
IsValidUniverseID ( |
Returns true if the Universe ID is valid for the protocol |
|
|
MakeValidUniverseID ( |
Returns a valid Universe ID as close as possible to the provided Universe ID |
|
|
RegisterInputPort ( |
Called to register a DMXInputPort with the protocol. |
|
|
TSharedPtr< ... |
RegisterOutputPort ( |
Called to register a DMXOutputPort with the protocol. |
|
UnregisterInputPort ( |
Called to unregister a DMXInputPort with the protocol. |
|
|
UnregisterOutputPort ( |
Called to unregister a DMXOutputPort with the protocol. |