9#define GEMINI_MIN_BRIGHTNESS 0
10#define GEMINI_MAX_BRIGHTNESS 255
11#define SERIAL_TIMEOUT_SEC 10
12#define SERIAL_TIMEOUT_SEC_LONG 120
179 virtual bool getStatus(
int *coverStatus,
int *lightStatus,
int *motorStatus) = 0;
189 virtual bool move(uint16_t value,
int direction) = 0;
257 bool formatCommand(
char commandLetter,
char *commandString,
int value =
NO_VALUE);
267 bool sendCommand(
const char *command,
char *response,
int timeout =
SERIAL_TIMEOUT_SEC,
bool log =
true);
276 bool extractIntValue(
const char *response,
int startPos,
int *value);
282 bool ping()
override;
311 bool getStatus(
int *coverStatus,
int *lightStatus,
int *motorStatus)
override;
314 bool move(uint16_t value,
int direction)
override;
337 this->portFD = portFD;
365 bool formatCommand(
char commandLetter,
char *commandString,
int value =
NO_VALUE);
375 bool sendCommand(
const char *command,
char *response,
int timeout =
SERIAL_TIMEOUT_SEC,
bool log =
true);
384 bool extractIntValue(
const char *response,
int startPos,
int *value);
390 bool ping()
override;
419 bool getStatus(
int *coverStatus,
int *lightStatus,
int *motorStatus)
override;
422 bool move(uint16_t value,
int direction)
override;
427 bool setBeep(
bool enable)
override;
437 this->portFD = portFD;
465 bool formatCommand(
char commandLetter,
char *commandString,
int value =
NO_VALUE);
475 bool sendCommand(
const char *command,
char *response,
int timeout =
SERIAL_TIMEOUT_SEC,
bool log =
true);
484 bool extractIntValue(
const char *response,
int startPos,
int *value);
490 bool ping()
override;
519 bool getStatus(
int *coverStatus,
int *lightStatus,
int *motorStatus)
override;
522 bool move(uint16_t value,
int direction)
override
538 bool setBeep(
bool enable)
override;
548 this->portFD = portFD;
576 bool formatCommand(
char commandLetter,
char *commandString,
int value =
NO_VALUE);
586 bool sendCommand(
const char *command,
char *response,
int timeout =
SERIAL_TIMEOUT_SEC,
bool log =
true);
595 bool extractIntValue(
const char *response,
int startPos,
int *value);
601 bool ping()
override;
630 bool getStatus(
int *coverStatus,
int *lightStatus,
int *motorStatus)
override;
633 bool move(uint16_t value,
int direction)
override;
638 bool setBeep(
bool enable)
override;
648 this->portFD = portFD;
664 bool ping()
override;
681 bool getStatus(
int *coverStatus,
int *lightStatus,
int *motorStatus)
override;
684 bool move(uint16_t value,
int direction)
override;
689 bool setBeep(
bool enable)
override;
710 int simulationValues[SIM_N];
711 bool simulateRev2Features;
712 int simulatedRevision;
713 int simulatedFirmwareVersion;
void log(const std::string &log)
Abstract adapter interface for Gemini Flatpanel firmware versions.
virtual bool getFirmwareVersion(int *version)=0
Get the firmware version from the device.
virtual char getCommandTerminator() const =0
Get the command terminator character for this revision.
virtual bool setOpenPosition()=0
Set the current position as the open position.
virtual bool openCover()=0
Open the dust cover.
virtual bool supportsBeep() const =0
Check if device supports beep functionality.
virtual bool supportsBrightnessMode() const =0
Check if device supports brightness mode selection (high/low)
virtual bool move(uint16_t value, int direction)=0
Move the cover by a specified amount.
virtual bool getConfigStatus(int *status)=0
Get the current configuration status.
virtual bool supportsDustCap() const =0
Check if device supports dust cap functionality.
virtual ~GeminiFlatpanelAdapter()=default
virtual bool closeCover()=0
Close the dust cover.
virtual void setupCommunication(int portFD)=0
Set up communication parameters for this revision.
virtual bool setBeep(bool enable)=0
Enable or disable beep functionality.
virtual bool getBrightness(int *brightness)=0
Get the current brightness level.
virtual bool lightOff()=0
Turn the light off.
virtual bool getStatus(int *coverStatus, int *lightStatus, int *motorStatus)=0
Get the current device status.
virtual bool lightOn()=0
Turn the light on.
virtual bool setBrightness(int value)=0
Set the brightness level.
virtual bool setClosePosition()=0
Set the current position as the closed position.
virtual int getRevision() const =0
Get the firmware revision this adapter supports.
virtual bool setBrightnessMode(int mode)=0
Set the brightness mode (high/low)
virtual bool ping()=0
Ping the device to check if it responds to this adapter's protocol.
Concrete adapter implementation for Gemini Flatpanel Lite firmware.
bool getBrightness(int *brightness) override
Get the current brightness level.
bool setOpenPosition() override
Set the current position as the open position.
bool move(uint16_t value, int direction) override
Move the cover by a specified amount.
bool setBrightnessMode(int mode) override
Set the brightness mode (high/low)
bool supportsDustCap() const override
Check if device supports dust cap functionality.
bool openCover() override
Open the dust cover.
bool lightOff() override
Turn the light off.
bool closeCover() override
Close the dust cover.
GeminiFlatpanelLiteAdapter()
bool lightOn() override
Turn the light on.
bool ping() override
Ping the device to check if it responds to this adapter's protocol.
char getCommandTerminator() const override
Get the command terminator character for this revision.
bool getConfigStatus(int *status) override
Get the current configuration status.
bool supportsBeep() const override
Check if device supports beep functionality.
int getRevision() const override
Get the firmware revision this adapter supports.
void setupCommunication(int portFD) override
Set up communication parameters for this revision.
bool getStatus(int *coverStatus, int *lightStatus, int *motorStatus) override
Get the current device status.
bool setBrightness(int value) override
Set the brightness level.
bool setBeep(bool enable) override
Enable or disable beep functionality.
bool setClosePosition() override
Set the current position as the closed position.
bool getFirmwareVersion(int *version) override
Get the firmware version from the device.
bool supportsBrightnessMode() const override
Check if device supports brightness mode selection (high/low)
Concrete adapter implementation for Gemini Pro firmware.
bool supportsBeep() const override
Check if device supports beep functionality.
bool lightOff() override
Turn the light off.
bool setOpenPosition() override
Set the current position as the open position.
bool openCover() override
Open the dust cover.
bool setClosePosition() override
Set the current position as the closed position.
bool getBrightness(int *brightness) override
Get the current brightness level.
GeminiFlatpanelProAdapter()
bool move(uint16_t value, int direction) override
Move the cover by a specified amount.
bool supportsBrightnessMode() const override
Check if device supports brightness mode selection (high/low)
bool setBrightness(int value) override
Set the brightness level.
bool getConfigStatus(int *status) override
Get the current configuration status.
void setupCommunication(int portFD) override
Set up communication parameters for this revision.
bool setBeep(bool enable) override
Enable or disable beep functionality.
bool supportsDustCap() const override
Check if device supports dust cap functionality.
bool lightOn() override
Turn the light on.
bool setBrightnessMode(int mode) override
Set the brightness mode (high/low)
char getCommandTerminator() const override
Get the command terminator character for this revision.
int getRevision() const override
Get the firmware revision this adapter supports.
bool getStatus(int *coverStatus, int *lightStatus, int *motorStatus) override
Get the current device status.
bool getFirmwareVersion(int *version) override
Get the firmware version from the device.
bool closeCover() override
Close the dust cover.
bool ping() override
Ping the device to check if it responds to this adapter's protocol.
Concrete adapter implementation for Gemini Flatpanel Revision 1 firmware.
bool setClosePosition() override
Set the current position as the closed position.
bool getConfigStatus(int *status) override
Get the current configuration status.
bool supportsDustCap() const override
Check if device supports dust cap functionality.
bool move(uint16_t value, int direction) override
Move the cover by a specified amount.
bool getFirmwareVersion(int *version) override
Get the firmware version from the device.
bool lightOff() override
Turn the light off.
int getRevision() const override
Get the firmware revision this adapter supports.
bool setBrightnessMode(int mode) override
Set the brightness mode (high/low)
bool openCover() override
Open the dust cover.
bool lightOn() override
Turn the light on.
bool supportsBeep() const override
Check if device supports beep functionality.
bool supportsBrightnessMode() const override
Check if device supports brightness mode selection (high/low)
bool getBrightness(int *brightness) override
Get the current brightness level.
bool setBeep(bool enable) override
Enable or disable beep functionality.
GeminiFlatpanelRev1Adapter()
void setupCommunication(int portFD) override
Set up communication parameters for this revision.
bool setBrightness(int value) override
Set the brightness level.
char getCommandTerminator() const override
Get the command terminator character for this revision.
bool closeCover() override
Close the dust cover.
bool getStatus(int *coverStatus, int *lightStatus, int *motorStatus) override
Get the current device status.
bool ping() override
Ping the device to check if it responds to this adapter's protocol.
bool setOpenPosition() override
Set the current position as the open position.
Concrete adapter implementation for Gemini Flatpanel Revision 2 firmware.
bool getStatus(int *coverStatus, int *lightStatus, int *motorStatus) override
Get the current device status.
bool lightOff() override
Turn the light off.
GeminiFlatpanelRev2Adapter()
bool getConfigStatus(int *status) override
Get the current configuration status.
bool supportsBeep() const override
Check if device supports beep functionality.
bool setBrightness(int value) override
Set the brightness level.
char getCommandTerminator() const override
Get the command terminator character for this revision.
bool setBrightnessMode(int mode) override
Set the brightness mode (high/low)
int getRevision() const override
Get the firmware revision this adapter supports.
void setupCommunication(int portFD) override
Set up communication parameters for this revision.
bool supportsBrightnessMode() const override
Check if device supports brightness mode selection (high/low)
bool setClosePosition() override
Set the current position as the closed position.
bool setOpenPosition() override
Set the current position as the open position.
bool setBeep(bool enable) override
Enable or disable beep functionality.
bool openCover() override
Open the dust cover.
bool getFirmwareVersion(int *version) override
Get the firmware version from the device.
bool move(uint16_t value, int direction) override
Move the cover by a specified amount.
bool getBrightness(int *brightness) override
Get the current brightness level.
bool supportsDustCap() const override
Check if device supports dust cap functionality.
bool ping() override
Ping the device to check if it responds to this adapter's protocol.
bool lightOn() override
Turn the light on.
bool closeCover() override
Close the dust cover.
Simulation adapter for testing and development.
bool getBrightness(int *brightness) override
Get the current brightness level.
bool supportsBrightnessMode() const override
Check if device supports brightness mode selection (high/low)
bool setBeep(bool enable) override
Enable or disable beep functionality.
bool setBrightnessMode(int mode) override
Set the brightness mode (high/low)
bool closeCover() override
Close the dust cover.
bool supportsDustCap() const override
Check if device supports dust cap functionality.
bool openCover() override
Open the dust cover.
int getRevision() const override
Get the firmware revision this adapter supports.
bool getFirmwareVersion(int *version) override
Get the firmware version from the device.
bool lightOn() override
Turn the light on.
bool getStatus(int *coverStatus, int *lightStatus, int *motorStatus) override
Get the current device status.
bool setClosePosition() override
Set the current position as the closed position.
void setupCommunication(int portFD) override
Set up communication parameters for this revision.
char getCommandTerminator() const override
Get the command terminator character for this revision.
bool setBrightness(int value) override
Set the brightness level.
bool supportsBeep() const override
Check if device supports beep functionality.
bool getConfigStatus(int *status) override
Get the current configuration status.
bool lightOff() override
Turn the light off.
bool move(uint16_t value, int direction) override
Move the cover by a specified amount.
bool setOpenPosition() override
Set the current position as the open position.
bool ping() override
Ping the device to check if it responds to this adapter's protocol.
#define SERIAL_TIMEOUT_SEC
@ GEMINI_REVISION_UNKNOWN
@ GEMINI_COVER_STATUS_TIMED_OUT
@ GEMINI_COVER_STATUS_CLOSED
@ GEMINI_COVER_STATUS_OPEN
@ GEMINI_COVER_STATUS_MOVING
@ GEMINI_BRIGHTNESS_MODE_HIGH
@ GEMINI_BRIGHTNESS_MODE_LOW
@ GEMINI_MOTOR_STATUS_STOPPED
@ GEMINI_MOTOR_STATUS_RUNNING
@ GEMINI_LIGHT_STATUS_OFF