#ifndef __UT_ROBOT_SDK_CLIENT_HPP__ #define __UT_ROBOT_SDK_CLIENT_HPP__ #include #include #define UT_ROBOT_CLIENT_REG_API_NO_PROI(apiId) \ UT_ROBOT_CLIENT_REG_API(apiId, 0) #define UT_ROBOT_CLIENT_REG_API(apiId, proirity) \ RegistApi(apiId, proirity) namespace unitree { namespace robot { /* * @brief * @class: Client */ class Client: public ClientBase { public: explicit Client(const std::string& name, bool enableLease = false); virtual ~Client(); void WaitLeaseApplied(); int64_t GetLeaseId(); const std::string& GetApiVersion() const; std::string GetServerApiVersion(); protected: void SetApiVersion(const std::string& apiVersion); int32_t Call(int32_t apiId, const std::string& parameter, std::string& data); int32_t Call(int32_t apiId, const std::string& parameter); int32_t Call(int32_t apiId, const std::vector& parameter, std::vector& data); int32_t Call(int32_t apiId, const std::vector& parameter); void RegistApi(int32_t apiId, int32_t proirity = 0); int32_t CheckApi(int32_t apiId, int32_t& proirity, int64_t& leaseId); private: bool mEnableLease; std::string mApiVersion; std::unordered_map mApiMap; LeaseClientPtr mLeaseClientPtr; }; using ClientPtr = std::shared_ptr; } } #endif//__UT_ROBOT_SDK_CLIENT_HPP__