HosrDiretta
Loading...
Searching...
No Matches
DIRETTA::Sync Class Referenceabstract

Sync class Processing stream transmission. More...

#include <Sync.hpp>

Inheritance diagram for DIRETTA::Sync:
DIRETTA::Connection DIRETTA::SyncBuffer

Classes

struct  Info
 sink information More...
 

Public Types

enum  THRED_MODE {
  CRITICAL =1 , NOSHORTSLEEP =2 , NOSLEEP4CORE =4 , OCCUPIED =16 ,
  FEEDBACKOFFSET =32 , FEEDBACKMASK =0x7*FEEDBACKOFFSET , NOFASTFEEDBACK = 256 , IDLEONE =512 ,
  IDLEALL =1024 , NOSLEEPFORCE =2048 , LIMITRESEND =4096 , NOJUMBOFRAME =8192 ,
  NOFIREWALL =16384 , NORAWSOCKET =32768
}
 Thread mode enumeration bit or. More...
 
enum  MSMODE {
  MSMODE_NONE =0 , MSMODE_MS1 =1 , MSMODE_MS2 =2 , MSMODE_MS3 =4 ,
  MSMODE_AUTO =4+1
}
 Multi-Stream Mode. More...
 

Public Member Functions

 Sync ()
 Constructor self socket.
 
 Sync (ACQUA::EthernetSocket &udp, ACQUA::EthernetSocket *raw)
 constructor with socket
 
 ~Sync ()
 Destructor.
 
bool open (THRED_MODE mode, ACQUA::Clock info, uint16_t ifno, const std::string &name, std::uint64_t id, int cpuMain, int cpuOther, int rngOther, MSMODE msMode)
 open
 
void changeWorkMode (THRED_MODE)
 
THRED_MODE currentWorkMode () const
 get current thread mode
 
THRED_MODE currentWorkMode (int &cpuMain, int &cpuOther, int &rngOther) const
 get current thread mode with cpu occupied
 
void setHostInvertPhase (bool)
 set host invert phase (When the data being written is reversed)
 
bool setSink (const ACQUA::IPAddress &, ACQUA::Clock, bool, std::uint32_t)
 setup sink connection
 
bool setSinkConfigure (FormatConfigure)
 set sink playback format
 
void setConfigTransfer (const Profile &)
 set sync profile(Configure the transmission cycle using a Profile. A Profile must be set up beforehand.)
 
ProfileMaker getProfileMaker (ACQUA::Clock)
 get ProfileMaker for creating Profile
 
void configTransferAuto (ACQUA::Clock, ACQUA::Clock, ACQUA::Clock)
 Configure automatic data transfer settings based on the specified cycle time.
 
bool configTransferFix (ACQUA::Clock, int)
 fix-cycle configuration
 
bool configTransferVar (ACQUA::Clock, int)
 variable-cycle configuration
 
void configTransferVarMax (ACQUA::Clock)
 Adjust to use the maximum network packet size configuration.
 
bool configTransferFixAuto (ACQUA::Clock)
 
bool configTransferVarAuto (ACQUA::Clock)
 
bool configTransferRandom (ACQUA::Clock, ACQUA::Clock, int)
 random-cycle configuration
 
ACQUA::Clock getCycleTime () const
 get Generated transmission interval
 
ACQUA::Clock getMinCycleTime () const
 get Minimum transmission interval
 
std::size_t getCycleSize () const
 get Stream data size per transmission
 
std::size_t getCyclePackets () const
 get Stream packet count per transmission
 
Profile::ModeType getMode () const
 get Send Profile Mode
 
bool connectPrepare (bool=true)
 prepare to connect
 
bool connect (int)
 connect to sink
 
bool connectWait ()
 wait for connection completion
 
void disconnect_flgset ()
 Set the flag to start cutting.
 
void disconnect (bool wait=true)
 disconnect from sink
 
bool disconnectWait ()
 wait for disconnection completion
 
void play ()
 start playback
 
void stop ()
 stop playback(pause)
 
bool isPlay () const
 is playing
 
void close ()
 close sync
 
bool is_connect ()
 check connection state
 
bool is_online ()
 check online state
 
bool is_disconnect ()
 check disconnect state
 
bool is_active ()
 check active state
 
ACQUA::Clock getLatency ()
 get sink latency
 
bool checkSinkSupport (FormatConfigure) const
 check sink format support
 
const FormatConfiguregetSinkConfigure () const
 get sink format configuration
 
bool inquirySupportFormat (const ACQUA::IPAddress &)
 Retrieve the supported formats for Sink.
 
bool inquiryParameter (const ACQUA::IPAddress &, std::uint32_t, std::uint32_t)
 Retrieve the TargetProfile for the Sink.
 
std::uint32_t mtuTest (const ACQUA::IPAddress &, std::uint16_t, std::uint32_t)
 MTU test.
 
bool mtuCheck (const ACQUA::IPAddress &, std::uint32_t &)
 MTU check.
 
std::uint32_t getNoneBaseMin () const
 get minimum frame size without base rate
 
std::uint32_t getFrameMax () const
 get maximum frame size without base rate
 
bool syncWorker ()
 sync worker process
 
const InfogetSinkInfo () const
 get sink information
 
- Public Member Functions inherited from DIRETTA::Connection
 Connection ()
 create connection
 
 Connection (ACQUA::EthernetSocket &)
 create connection with socket
 
 ~Connection ()
 destroy connection
 
void setAdditionalAddress (const std::list< ACQUA::IPAddress > &add)
 Configure the address of a Target that cannot respond to multicast.
 

Protected Member Functions

virtual bool getNewStream (diretta_stream &)=0
 Callback for retrieving the send stream from the send thread (Must be processed by Atomic)
 
virtual bool getNewStreamCmp ()
 
virtual bool startSyncWorker ()
 
virtual void statusUpdate ()
 
- Protected Member Functions inherited from DIRETTA::Connection
bool open (ACQUA::IPAddress &)
 open socket
 
void close ()
 close socket
 
bool sendAck (const ConnectionBuffer &, const ACQUA::IPAddress &, MessageID, ConnectionBuffer &, ACQUA::Clock=ACQUA::Clock::MilliSeconds(30))
 Send message and wait for response.
 
bool send (const ConnectionBuffer &data)
 Send message.
 
bool receive (ConnectionBuffer &data, ACQUA::IPAddress &add, ACQUA::Clock wtt=ACQUA::Clock())
 Receive message.
 
bool member (const ACQUA::IPAddress &addme)
 Begin receiving multicast data (join members)
 
bool sendMulti (const ConnectionBuffer &msg, MessageID respMsg, std::map< ACQUA::IPAddress, std::unique_ptr< ConnectionBuffer > > &resalt, bool)
 Send message to multiple message and wait for response.
 
std::list< IfInfogetIfList (bool, bool discash=false)
 Get network interfaces.
 
bool getIfMTU (std::uint32_t, std::uint32_t &)
 Get MTU of interface.
 
 operator ACQUA::EthernetSocket * ()
 Get socket object pointer.
 

Additional Inherited Members

- Static Protected Member Functions inherited from DIRETTA::Connection
static void dumpfile (ACQUA::BufferCS_const, const std::string &=std::string())
 Dump packet data during debugging.
 
- Protected Attributes inherited from DIRETTA::Connection
std::list< IfInfoIfList
 
bool IfListLoop
 
ACQUA::EthernetSocketudpCn
 
const bool udpSelf
 

Detailed Description

Sync class Processing stream transmission.

Member Enumeration Documentation

◆ MSMODE

Multi-Stream Mode.

Enumerator
MSMODE_NONE 

disable multi stream

MSMODE_MS1 

1or0

MSMODE_MS2 

must 2

MSMODE_MS3 

3or1

MSMODE_AUTO 

/3 1 0

◆ THRED_MODE

Thread mode enumeration bit or.

Enumerator
CRITICAL 

Set the priority of the sending thread to critical.

NOSHORTSLEEP 

Do not enter Sleep mode for a short period of time (busy loop)

NOSLEEP4CORE 

If fewer than four cores are available, do not perform a busy loop.

OCCUPIED 

Use the CPU by fixing it to a thread (not exclusively)

FEEDBACKOFFSET 

Move the transmission feedback to the moving average.

IDLEONE 

Run Idle every time (busy loop)

IDLEALL 

Always run Idle (busy loop)

NOSLEEPFORCE 

force busy loop

LIMITRESEND 

Limit the amount of retransmission buffer allocated.

NOJUMBOFRAME 

Do not use jumbo frame(MTU)

NOFIREWALL 

Do not send packets to disable the firewall.

NORAWSOCKET 

Do not use raw socket(no use DDS mode3)

Constructor & Destructor Documentation

◆ Sync()

DIRETTA::Sync::Sync ( ACQUA::EthernetSocket & udp,
ACQUA::EthernetSocket * raw )

constructor with socket

Parameters
udpdata socket
rawdata raw socket (if nullptr not use DDS mode 3)

Member Function Documentation

◆ configTransferAuto()

void DIRETTA::Sync::configTransferAuto ( ACQUA::Clock ,
ACQUA::Clock ,
ACQUA::Clock  )

Configure automatic data transfer settings based on the specified cycle time.

Parameters
MinimumSync System Time
TargetCycle Time ( Set zero as the default setting
MaximumCycle Time (Recovery procedure when the system is busy

◆ configTransferFix()

bool DIRETTA::Sync::configTransferFix ( ACQUA::Clock ,
int  )

fix-cycle configuration

Parameters
cycleTimeTarget Cycle Time
MaximumSimultaneous Transmissions (Fragment Count)
Returns
success or failure

◆ configTransferVar()

bool DIRETTA::Sync::configTransferVar ( ACQUA::Clock ,
int  )

variable-cycle configuration

Parameters
cycleTimeTarget Cycle Time
MaximumSimultaneous Transmissions (Fragment Count)
Returns
success or failure

◆ connectPrepare()

bool DIRETTA::Sync::connectPrepare ( bool = true)

prepare to connect

Parameters
Automaticallyadjust Trget delay

◆ disconnect()

void DIRETTA::Sync::disconnect ( bool wait = true)

disconnect from sink

Parameters
waitwait for disconnection completion

◆ getNewStream()

virtual bool DIRETTA::Sync::getNewStream ( diretta_stream & )
protectedpure virtual

Callback for retrieving the send stream from the send thread (Must be processed by Atomic)

Parameters
streamdiretta_stream to be sent.Base class for Stream(diretta_stream = Stream copy to the base struct Stream::diretta_stream). (The pointer must remain valid until it is dereferenced or this function is called again.)
Returns
false indicates termination; the buffer is not processed at that time.

Implemented in DIRETTA::SyncBuffer.

◆ getProfileMaker()

ProfileMaker DIRETTA::Sync::getProfileMaker ( ACQUA::Clock )

get ProfileMaker for creating Profile

Parameters
limitCycleMinimum period time (maximum transmission frequency) for Sync (Host)
Returns
ProfileMaker

◆ open()

bool DIRETTA::Sync::open ( THRED_MODE mode,
ACQUA::Clock info,
uint16_t ifno,
const std::string & name,
std::uint64_t id,
int cpuMain,
int cpuOther,
int rngOther,
MSMODE msMode )

open

Parameters
modethred model
InformationPacket Cycle
ifnohost interface number
namemy name
idmy Vender
cpuMainCPU number of the main thread (when occupied)
cpuOtherCPU number of the other thread (when occupied)
rngOtherCPU number of the other thread random range (when occupied)
msModemulti stream mode reruest
Returns
success or failure

◆ setSink()

bool DIRETTA::Sync::setSink ( const ACQUA::IPAddress & ,
ACQUA::Clock ,
bool ,
std::uint32_t  )

setup sink connection

Parameters
sinkaddress
Sinkbuffer time (if zeoro use default sink buffer time)
DisableSink's playback rejection (NOP)
ActivateMTU Use this value to calculate the transmission size.

The documentation for this class was generated from the following file: