47 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
48 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
79 bool setParam(
const std::string ¶m, uint32_t value);
80 bool getParam(
const std::string ¶m, uint32_t &value);
81 bool gotoTarget(uint32_t position);
85 double calculateAngle(uint32_t steps);
90 bool sendCommand(
const char *
cmd, int32_t &res);
91 void hexDump(
char * buf,
const char * data,
int size);
92 std::vector<std::string> split(
const std::string &input,
const std::string ®ex);
100 enum { PARAM_STEPS_DEGREE };
103 INDI::PropertyNumber RotatorAbsPosNP {1};
109 bool m_IsMoving {
false};
110 uint32_t m_ZeroPosition {0};
115 static constexpr const char * SETTINGS_TAB =
"Settings";
117 static const char DRIVER_STOP_CHAR { 0x23 };
119 static constexpr const uint8_t DRIVER_TIMEOUT {3};
121 static constexpr const uint8_t DRIVER_LEN {128};
123 static constexpr const uint8_t DRIVER_OPERATIVES {2};
125 static constexpr const uint8_t DRIVER_MODELS {4};
127 INDI::PropertySwitch SteppingModeSP {3};
135 INDI::PropertySwitch CoilStatusSP {2};
142 INDI::PropertyNumber SteppingPhaseNP{3};
144 INDI::PropertyNumber MaxSpeedNP {1};
147 bool readCompensationInfo();
148 bool readSpeedInfo();
149 bool readSteppingInfo();
150 bool readCoilStatus();
151 bool setSteppingPhase(uint8_t phase);
152 bool setCoilStatus(uint8_t status);
153 bool setMaxSpeed(uint8_t maxSpeed);
155 bool sendCommand(
const char *
cmd,
char * res =
nullptr,
int cmd_len = -1,
int res_len = -1);
156 bool getStartupValues();
159 int32_t m_TargetDiff { 0 };
160 double requestedAngle = -1.0;
161 bool wantAbort =
false;
164 static constexpr const char * STEPPING_TAB =
"Stepping";
166 static const char NFRAME_STOP_CHAR { 0x23 };
168 static constexpr const uint8_t NFRAME_TIMEOUT {3};
170 static constexpr const uint8_t NFRAME_LEN {64};
virtual bool SyncRotator(double angle) override
SyncRotator Set current angle as the supplied angle without moving the rotator.
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual IPState MoveRotator(double angle) override
MoveRotator Go to specific angle.
bool SyncRotator(uint32_t ticks)
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the reverse direction property in the configuration file
virtual ~nFrameRotator() override=default
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
virtual bool Handshake() override
perform handshake with device to check communication
INDI::PropertyNumber RotatorSpeedNP
bool SetRotatorSpeed(uint8_t speed)
const char * getDefaultName() override
virtual bool AbortRotator() override
AbortRotator Abort all motion.
INumberVectorProperty RotateSyncNP
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
INumberVectorProperty RotateMaxPosNP
struct _INumberVectorProperty INumberVectorProperty
*brief user defined string literal for JSON values *sa std::size_t n