94 explicit WASimClient(uint32_t clientId,
const std::string &configFile = std::string());
102 bool isInitialized()
const;
103 bool isConnected()
const;
104 uint32_t clientVersion()
const;
105 uint32_t serverVersion()
const;
115 HRESULT connectSimulator(uint32_t timeout = 0);
124 HRESULT connectSimulator(
int networkConfigId, uint32_t timeout = 0);
127 void disconnectSimulator();
134 uint32_t pingServer(uint32_t timeout = 0);
144 HRESULT connectServer(uint32_t timeout = 0);
146 void disconnectServer();
150 uint32_t defaultTimeout()
const;
152 void setDefaultTimeout(uint32_t ms);
156 int networkConfigurationId()
const;
159 void setNetworkConfigurationId(
int configId);
200 HRESULT getVariable(
const VariableRequest &variable,
double *pfResult, std::string *psResult =
nullptr);
207 HRESULT getLocalVariable(
const std::string &variableName,
double *pfResult,
const std::string &unitName = std::string());
215 HRESULT getOrCreateLocalVariable(
const std::string &variableName,
double *pfResult,
double defaultValue = 0.0,
const std::string &unitName = std::string());
233 HRESULT setVariable(
const VariableRequest &variable,
const double value);
238 HRESULT setVariable(
const VariableRequest &variable,
const std::string &stringValue);
246 HRESULT setLocalVariable(
const std::string &variableName,
const double value,
const std::string &unitName = std::string());
255 HRESULT setOrCreateLocalVariable(
const std::string &variableName,
const double value,
const std::string &unitName = std::string());
262 inline HRESULT
setSimVarVariable(
const std::string &variableName,
const std::string &unitName,
double value) {
return setVariable(
VariableRequest(variableName, unitName), value); }
266 inline HRESULT
setSimVarVariable(
const std::string &variableName, uint8_t index,
const std::string &unitName,
double value) {
return setVariable(
VariableRequest(variableName, unitName, index), value); }
274 inline HRESULT
setSimVarVariable(
const std::string &variableName, uint8_t index,
const std::string &stringValue) {
return setVariable(
VariableRequest(variableName, {}, index), stringValue); }
293 HRESULT saveDataRequest(
const DataRequest &request,
bool async =
false);
301 HRESULT removeDataRequest(
const uint32_t requestId);
307 HRESULT updateDataRequest(uint32_t requestId);
313 std::vector<DataRequestRecord> dataRequests()
const;
315 std::vector<uint32_t> dataRequestIdsList()
const;
323 HRESULT setDataRequestsPaused(
bool paused)
const;
340 HRESULT removeEvent(uint32_t eventId);
345 HRESULT transmitEvent(uint32_t eventId);
351 std::vector<RegisteredEvent> registeredEvents()
const;
379 HRESULT sendKeyEvent(uint32_t keyEventId, uint32_t v1 = 0, uint32_t v2 = 0, uint32_t v3 = 0, uint32_t v4 = 0, uint32_t v5 = 0)
const;
396 HRESULT sendKeyEvent(
const std::string &keyEventName, uint32_t v1 = 0, uint32_t v2 = 0, uint32_t v3 = 0, uint32_t v4 = 0, uint32_t v5 = 0);
418 HRESULT registerCustomKeyEvent(
const std::string &customEventName, uint32_t *puiCustomEventId =
nullptr,
bool useLegacyTransmit =
false);
425 HRESULT removeCustomKeyEvent(
const std::string &customEventName);
430 HRESULT removeCustomKeyEvent(uint32_t eventId);
460 HRESULT sendCommand(
const Command &command)
const;
467 HRESULT sendCommandWithResponse(
const Command &command,
Command *response, uint32_t timeout = 0);
502 template<
class Tcaller>
503 inline void setClientEventCallback(
void(__stdcall Tcaller::*
const member)(
const ClientEvent &), Tcaller *
const caller);
513 template<
class Tcaller>
514 inline void setListResultsCallback(
void(__stdcall Tcaller::*
const member)(
const ListResult &), Tcaller *
const caller);
523 template<
class Tcaller>
524 inline void setDataCallback(
void(__stdcall Tcaller::*
const member)(
const DataRequestRecord &), Tcaller *
const caller);
533 template<
class Tcaller>
534 inline void setLogCallback(
void(__stdcall Tcaller::*
const member)(
const LogRecord &,
LogSource), Tcaller *
const caller);
547 template<
class Tcaller>
548 inline void setCommandResultCallback(
void(__stdcall Tcaller::*
const member)(
const Command &), Tcaller *
const caller);
559 template<
class Tcaller>
560 inline void setResponseCallback(
void(__stdcall Tcaller::*
const member)(
const Command &), Tcaller *
const caller);
566#pragma warning( suppress: 4251 )
567 const std::unique_ptr<Private> d;
569 friend class Private;