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;
80 bool setParam(
const std::string ¶m, uint32_t value);
81 bool getParam(
const std::string ¶m, uint32_t &value);
82 bool gotoTarget(uint32_t position);
86 double calculateAngle(uint32_t steps);
91 bool sendCommand(
const char *
cmd, int32_t &res);
92 void hexDump(
char * buf,
const char * data,
int size);
93 std::vector<std::string> split(
const std::string &input,
const std::string ®ex);
102 enum { PARAM_STEPS_DEGREE };
112 bool m_IsMoving {
false};
113 uint32_t m_ZeroPosition {0};
118 static constexpr
const char * SETTINGS_TAB =
"Settings";
120 static const char DRIVER_STOP_CHAR { 0x23 };
122 static constexpr
const uint8_t DRIVER_TIMEOUT {3};
124 static constexpr
const uint8_t DRIVER_LEN {128};
126 static constexpr
const uint8_t DRIVER_OPERATIVES {2};
128 static constexpr
const uint8_t DRIVER_MODELS {4};
154 bool readCompensationInfo();
155 bool readSpeedInfo();
156 bool readSteppingInfo();
157 bool readCoilStatus();
158 bool setSteppingPhase(uint8_t phase);
159 bool setCoilStatus(uint8_t status);
160 bool setMaxSpeed(uint8_t maxSpeed);
162 bool sendCommand(
const char *
cmd,
char * res =
nullptr,
int cmd_len = -1,
int res_len = -1);
163 bool getStartupValues();
166 int32_t m_TargetDiff { 0 };
167 double requestedAngle = -1.0;
168 bool wantAbort =
false;
171 static constexpr
const char * STEPPING_TAB =
"Stepping";
173 static const char NFRAME_STOP_CHAR { 0x23 };
175 static constexpr
const uint8_t NFRAME_TIMEOUT {3};
177 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
INumberVectorProperty 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
Initilize properties initial state and value. The child class must implement this function.
INumberVectorProperty RotateMaxPosNP
Number vector property descriptor.
Switch vector property descriptor.