6 #ifndef IFM3D_DEVICE_LEGACY_DEVICE_H
7 #define IFM3D_DEVICE_LEGACY_DEVICE_H
9 #include <ifm3d/device/device.h>
16 using Ptr = std::shared_ptr<LegacyDevice>;
25 using device_family = ifm3d::Device::device_family;
47 static Ptr MakeShared(
48 const std::string& ip = ifm3d::DEFAULT_IP,
49 const std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT,
50 const std::string& password = ifm3d::DEFAULT_PASSWORD);
64 const std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT,
65 const std::string& password = ifm3d::DEFAULT_PASSWORD);
70 virtual std::string Password();
73 virtual std::string SessionID();
79 virtual void FactoryReset();
107 virtual std::string RequestSession();
121 virtual bool CancelSession();
130 virtual bool CancelSession(
const std::string& sid);
144 virtual int Heartbeat(
int hb);
146 virtual std::unordered_map<std::string, std::string> NetInfo();
147 virtual std::unordered_map<std::string, std::string> TimeInfo();
166 virtual void SetTemporaryApplicationParameters(
167 const std::unordered_map<std::string, std::string>& params);
173 virtual int ActiveApplication();
187 virtual json ApplicationList();
198 virtual std::vector<std::string> ApplicationTypes();
208 virtual std::vector<std::string> ImagerTypes();
221 virtual int CopyApplication(
int idx);
240 virtual int CreateApplication(
241 const std::string& type = DEFAULT_APPLICATION_TYPE);
249 virtual void DeleteApplication(
int idx);
258 virtual void SetCurrentTime(
int epoch_secs = -1);
264 virtual std::vector<std::uint8_t> UnitVectors();
270 virtual std::vector<std::uint8_t> ExportIFMConfig();
287 virtual std::vector<std::uint8_t> ExportIFMApp(
int idx);
293 virtual void ImportIFMConfig(
const std::vector<std::uint8_t>& bytes,
294 std::uint16_t flags = 0x0);
309 virtual int ImportIFMApp(
const std::vector<std::uint8_t>& bytes);
319 virtual void SetPassword(std::string password =
"");
321 json ToJSON()
override;
322 void FromJSON(
const json& j)
override;
323 void ForceTrigger()
override;
327 std::unique_ptr<Impl> pImpl;
346 std::function<
void(
const std::string&,
const std::string&)> SetFunc,
347 std::function<
void()> SaveFunc,
348 const std::string& name,
359 static bool getAppJSON(
int index,
const json& j,
json& app);
361 json ToJSON_(
const bool open_session =
true);
363 json getApplicationInfosToJSON();
367 #endif // IFM3D_DEVICE_LEGACY_DEVICE_H