MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
2 - Connecting to Loggers

When you construct a remote control interface, the number of Loggers expected to connect is specified in the constructor.

The value can be modified later. If the number of Loggers specified is greater than 0, then only that many Loggers will be allowed to connect. The default value is 0, which indicates there are no restrictions on Logger connections.

DtRemoteControlInterface* remoteControl = new DtRemoteControlInterface(appInit.numberOfLoggers());

The remote control interface (DtRemoteControlInterface) uses a VR-Link exercise connection to send and receive Logger control interactions. The remote control interface:

The connect and heartbeat transmission interval is configurable in the Logger using the SetRemoteControlSettings command. For details, please see logSimulationDomainCommands. The interface provides a method to configure the timeout interval (DtRemoteControlInterface::setConnectionTimeout()).

<command domain="Simulation" protocol="None"command="SetRemoteControlSettings">
<param name="process" var="processRemoteControl"></param>
<param name="record" var="recordRemoteControl"></param>
<param name="allowDelete" var="allowDelete"></param>
<param name="allowAll" var="allowAll"></param>
<param name="sendResponses" var="sendResponses"></param>
<param name="crippleGui" var="crippleGui"></param>
<param name="connectSendInterval" var="connectSendInterval"></param>
<param name="heartbeatSendInterval" var="heartbeatSendInterval"></param>
</command>

You can install callbacks for when the interface receives the connect, disconnect, heartbeat, and timeout events, as well as when a Logger total state message is received. The following code (from the remote control example) outputs the content of a Logger connection when it has timed out:

...
remoteControl->addCallbackConnectionTimedOut(timeoutCallback, 0);
...
void timeoutCallback( const DtRemoteLoggerConnection& loggerConnection, void* usr )
{
DtWarn << "Logger Connection timed out\n";
loggerConnection.printDataToStream(DtWarn);
}

[<< Introduction to the Remote Control Interface] [Home] [Top of Page] [Inspecting Logger State >>]


Document ID: Generated on Wed Jun 5 18:45:18 EDT 2019 from SVN revision 198968
Copyright © 2019 VT MAK. All Rights Reserved (www.mak.com)