28#define HTTPLIB_NO_EXCEPTIONS
31#ifdef _USE_SYSTEM_JSONLIB
32#include <nlohmann/json.hpp>
47 virtual bool Connect()
override;
51 virtual bool ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n)
override;
52 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
63 enum { DESCRIPTION, DRIVER_INFO, DRIVER_VERSION, INTERFACE_VERSION };
70 enum { TEMP_COMP_ENABLE, TEMP_COMP_DISABLE };
71 bool m_TempCompAvailable =
false;
74 std::unique_ptr<httplib::Client> m_AlpacaClient;
75 std::string m_Host =
"alpaca.local";
77 int m_DeviceNumber = 0;
78 uint32_t m_ClientID = 1;
79 uint32_t m_TransactionID = 0;
82 uint32_t m_TargetPosition = 0;
83 bool m_Moving =
false;
89 bool sendAlpacaGET(
const std::string &endpoint,
nlohmann::json &response);
90 bool sendAlpacaPUT(
const std::string &endpoint,
const std::string &data,
nlohmann::json &response);
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Processes incoming new switch states from the client for this device. Handles updates to FocuserInter...
virtual const char * getDefaultName() override
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
virtual bool updateProperties() override
Updates the state and definition of properties based on the current connection status....
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Processes incoming new text values from the client for this device. Delegates processing to the contr...
virtual bool Disconnect() override
Disconnect from device.
virtual bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual bool initProperties() override
Initializes the default properties for the focuser device. Sets up standard INDI properties,...
virtual bool Handshake() override
Performs a device-specific handshake after a connection is established. This method should be overrid...
a class to store JSON values