/** * @file * * @author Max Lammers * @author Mamadou Babaei * * @section LICENSE * * Copyright (c) 2020 - 2025 SenseGlove * * @section DESCRIPTION * * A class made specifically to test connections for SG Devices in the background. */ #pragma once #include #include #include #include namespace SGConnect { class Connection; class ConnectionTester; class IdResponse; class PortInfo; }// namespace SGConnect class SGCONNECT_API SGConnect::ConnectionTester { private: struct Impl; std::unique_ptr Pimpl; public: ConnectionTester(); /// /// /// ConnectionTester(const std::shared_ptr& connectionToTest, int32_t maximumIdAttempts = 1, int32_t maximumConnectAttempts = -1); virtual ~ConnectionTester(); public: [[nodiscard]] bool HandShakeComplete() const; [[nodiscard]] bool ValidDevice() const; [[nodiscard]] bool KeepTesting() const; [[nodiscard]] PortInfo GetPortInfo() const; [[nodiscard]] std::string GetAddress() const; [[nodiscard]] const std::string& GetConstants() const; [[nodiscard]] const std::string& GetHapticChannels() const; [[nodiscard]] const IdResponse& GetId() const; [[nodiscard]] bool IsConnected() const; void StopTesting(); bool GetConnection(std::shared_ptr& out_connection) const; /// Sets the release of Idle connections to true / false; /// void SetReleaseIdle(bool value); };