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;
91 bool isGOTOComplete();
93 bool readTemperature();
95 bool readCalibrationState();
96 bool readMaxSlewLimit();
98 bool readApproachDirection();
99 bool readStopDetect();
104 bool setFanEnabled(
bool enabled);
105 bool setCalibrationEnabled(
bool enabled);
106 bool setMotorSlewRate(uint8_t rate);
107 bool setApproachDirection(uint8_t direction);
108 bool setStopDetect(
bool enabled);
113 int readByte(
int fd, uint8_t *buf,
int timeout,
int *nbytes_read);
114 int readBytes(
int fd, uint8_t *buf,
int nbytes,
int timeout,
int *nbytes_read);
115 int writeBytes(
int fd,
const uint8_t *buf,
int nbytes,
int *nbytes_written);
116 int readPacket(
int fd, uint8_t *buf,
int nbytes,
int timeout,
int *nbytes_read);
117 bool sendCommand(
const uint8_t *
cmd, uint8_t * res, uint32_t cmd_len, uint32_t res_len);
118 char * efaDump(
char * buf,
int buflen,
const uint8_t * data, uint32_t size);
119 std::vector<std::string> split(
const std::string &input,
const std::string ®ex);
124 void getStartupValues();
125 double calculateTemperature(uint8_t byte2, uint8_t byte3);
126 bool validateLengths(
const uint8_t *
cmd, uint32_t len);
127 uint8_t calculateCheckSum(
const uint8_t *
cmd, uint32_t len);
128 template <
typename T> std::string to_string(
const T a_value,
const int n = 2);
154 FAN_AUTOMATIC_ABSOLUTE,
155 FAN_AUTOMATIC_RELATIVE,
171 FAN_OFF_ON_DISCONNECT
209 double m_LastTemperature[2] {0, 0};
210 double m_LastPosition {0};
212 bool IN_TIMER =
false;
218 static const uint8_t DRIVER_SOM { 0x3B };
220 static constexpr double TEMPERATURE_THRESHOLD { 0.05 };
222 static constexpr double TEMPERATURE_INVALID { -100.0 };
224 static constexpr const uint8_t DRIVER_LEN {9};
226 static constexpr const uint8_t DRIVER_TIMEOUT {3};
228 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.
@ MTR_GET_APPROACH_DIRECTION
@ MTR_SET_CALIBRATION_STATE
@ MTR_GET_CALIBRATION_STATE
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 SetFocuserSpeed(int speed) override
virtual bool initProperties() override
Initializes the default properties for the focuser device. Sets up standard INDI properties,...
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.