40 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
41 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
92 bool isGOTOComplete();
94 bool readTemperature();
96 bool readCalibrationState();
97 bool readMaxSlewLimit();
98 bool readApproachDirection();
99 bool readStopDetect();
104 bool setFanEnabled(
bool enabled);
105 bool setCalibrationEnabled(
bool enabled);
106 bool setApproachDirection(uint8_t direction);
107 bool setStopDetect(
bool enabled);
112 int readByte(
int fd, uint8_t *buf,
int timeout,
int *nbytes_read);
113 int readBytes(
int fd, uint8_t *buf,
int nbytes,
int timeout,
int *nbytes_read);
114 int writeBytes(
int fd,
const uint8_t *buf,
int nbytes,
int *nbytes_written);
115 int readPacket(
int fd, uint8_t *buf,
int nbytes,
int timeout,
int *nbytes_read);
116 bool sendCommand(
const uint8_t *
cmd, uint8_t * res, uint32_t cmd_len, uint32_t res_len);
117 char * efaDump(
char * buf,
int buflen,
const uint8_t * data, uint32_t size);
118 std::vector<std::string> split(
const std::string &input,
const std::string ®ex);
123 void getStartupValues();
124 double calculateTemperature(uint8_t byte2, uint8_t byte3);
125 bool validateLengths(
const uint8_t *
cmd, uint32_t len);
126 uint8_t calculateCheckSum(
const uint8_t *
cmd, uint32_t len);
127 template <
typename T> std::string to_string(
const T a_value,
const int n = 2);
141 INDI::PropertySwitch FanStateSP {2};
149 INDI::PropertySwitch FanControlSP {3};
153 FAN_AUTOMATIC_ABSOLUTE,
154 FAN_AUTOMATIC_RELATIVE,
158 INDI::PropertyNumber FanControlNP {3};
167 INDI::PropertySwitch FanDisconnectSP {1};
170 FAN_OFF_ON_DISCONNECT
174 INDI::PropertySwitch CalibrationStateSP {2};
182 INDI::PropertySwitch ApproachDirectionSP {2};
190 INDI::PropertySwitch StopDetectSP {2};
198 INDI::PropertyNumber TemperatureNP {2};
208 double m_LastTemperature[2] {0, 0};
209 double m_LastPosition {0};
211 bool IN_TIMER =
false;
217 static const uint8_t DRIVER_SOM { 0x3B };
219 static constexpr double TEMPERATURE_THRESHOLD { 0.05 };
221 static constexpr double TEMPERATURE_INVALID { -100.0 };
223 static constexpr const uint8_t DRIVER_LEN {9};
225 static constexpr const uint8_t DRIVER_TIMEOUT {3};
227 static constexpr const char *FAN_TAB =
"Fan";
virtual bool SyncFocuser(uint32_t ticks) override
Sync focuser.
virtual IPState MoveRelFocuser(FocusDirection dir, unsigned int ticks) override
Move Focuser relatively.
virtual bool ReverseFocuser(bool enabled) override
Reverse Focuser Motion.
virtual bool saveConfigItems(FILE *fp) override
virtual bool Handshake() override
Performs a device-specific handshake after a connection is established. This method should be overrid...
virtual bool SetFocuserMaxPosition(uint32_t ticks) override
Set Maximum Position.
const char * getDefaultName() override
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 void TimerHit() override
Callback function to be called once SetTimer duration elapses.
virtual bool updateProperties() override
Updates the state and definition of properties based on the current connection status....
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
Move Absolute Focuser.
virtual bool AbortFocuser() override
virtual bool initProperties() override
Initializes the default properties for the focuser device. Sets up standard INDI properties,...
@ MTR_GET_APPROACH_DIRECTION
@ MTR_SET_CALIBRATION_STATE
@ MTR_GET_CALIBRATION_STATE
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 Disconnect() override
Disconnect from device.
*brief user defined string literal for JSON values *sa std::size_t n