29 static std::unique_ptr<QHYCFW3> qhycfw(
new QHYCFW3());
39 return static_cast<const char *
>(
"QHYCFW3");
57 int rc = -1, nbytes_written = 0, nbytes_read = 0;
70 LOGF_ERROR(
"Handshake failed: %s. Firmware must be higher than 201409", error_message);
83 LOGF_ERROR(
"Handshake failed: %s. Firmware must be higher than 201409", error_message);
92 LOGF_ERROR(
"Handshake failed: %s. Firmware must be higher than 201409", error_message);
98 LOGF_INFO(
"Detected firmware version %s", res);
108 LOGF_ERROR(
"Querying maximum position failed: %s.", error_message);
119 LOGF_ERROR(
"Reading maximum position failed: %s.", error_message);
138 LOGF_ERROR(
"Querying current position failed: %s.", error_message);
149 LOGF_ERROR(
"Reading current position failed: %s.", error_message);
164 char cmd[8] = {0}, res[8] = {0};
165 int rc = -1, nbytes_written = 0, nbytes_read = 0;
180 LOGF_ERROR(
"Sending command select filter failed: %s", error_message);
189 LOGF_ERROR(
"Reading select filter response failed: %s", error_message);
void setVersion(uint16_t vMajor, uint16_t vMinor)
Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.
bool isSimulation() const
void addAuxControls()
Add Debug, Simulation, and Configuration options to the driver.
void SelectFilterDone(int newpos)
The child class calls this function when the hardware successfully finished selecting a new filter wh...
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
void setFilterConnection(const uint8_t &value)
setFilterConnection Set Filter connection mode. Child class should call this in the constructor befor...
int PortFD
For Serial & TCP connections.
bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
bool Handshake() override
perform handshake with device to check communication
const char * getDefaultName() override
bool SelectFilter(int) override
Select a new filter position.
int tty_read(int fd, char *buf, int nbytes, int timeout, int *nbytes_read)
read buffer from terminal
int tty_write_string(int fd, const char *buf, int *nbytes_written)
Writes a null terminated string to fd.
void tty_error_msg(int err_code, char *err_msg, int err_msg_len)
Retrieve the tty error message.
Implementations for common driver routines.
#define LOGF_INFO(fmt,...)
#define LOGF_DEBUG(fmt,...)
#define LOGF_ERROR(fmt,...)