42 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
43 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
44 virtual bool ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n)
override;
64 std::vector<std::string>
split(
const std::string &input,
const std::string ®ex);
67 bool updateFocusParams();
68 bool setSpeed(uint16_t speed);
69 bool getSpeed(
int &speed);
71 static bool parseReply(
const char *res,
const char *prefix,
int &value);
72 bool move(uint32_t newPosition);
73 std::string getFirmwareVersion();
75 uint32_t currentPosition { 0 };
76 uint32_t targetPosition { 0 };
77 bool isMoving =
false;
79 bool hasTemperatureSensor =
false;
81 std::chrono::steady_clock::time_point moveStarted;
82 static constexpr std::chrono::seconds MOVE_START_TIMEOUT {5};
86 PegasusAstro::WiFi wifi {
this};
88 INDI::PropertyNumber TemperatureNP {1};
89 INDI::PropertyText FirmwareVersionTP {1};
90 INDI::PropertyNumber SpeedNP {1};
virtual ~PegasusFocusCube3() override=default
virtual bool initProperties() override
Initializes the default properties for the focuser device. Sets up standard INDI properties,...
virtual bool saveConfigItems(FILE *fp) override
virtual bool SetFocuserBacklash(int32_t steps) override
SetFocuserBacklash Set the focuser backlash compensation value.
static constexpr const uint8_t PEGASUS_LEN
virtual void ISGetProperties(const char *dev) override
Handles client requests for property definitions for this device or all devices. Delegates to the bas...
virtual bool ReverseFocuser(bool enabled) override
ReverseFocuser Reverse focuser motion direction.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Processes incoming new number values from the client for this device. Handles updates to FocuserInter...
virtual bool SyncFocuser(uint32_t ticks) override
SyncFocuser Set current position to ticks without moving the focuser.
static constexpr const uint8_t PEGASUS_TIMEOUT
bool sendCommand(const char *cmd, char *res)
virtual bool updateProperties() override
Updates the state and definition of properties based on the current connection status....
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
const char * getDefaultName() override
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 IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
std::vector< std::string > split(const std::string &input, const std::string ®ex)
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 bool Handshake() override
Performs a device-specific handshake after a connection is established. This method should be overrid...
*brief user defined string literal for JSON values *sa std::size_t n