Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EAF firmware version info #9

Merged
merged 1 commit into from
Oct 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions indi-asi/asi_focuser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ bool ASIEAF::initProperties()
IUFillSwitch(&BeepS[BEEL_OFF], "OFF", "Off", ISS_OFF);
IUFillSwitchVector(&BeepSP, BeepS, 2, getDeviceName(), "FOCUS_BEEP", "Beep", OPTIONS_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE);

// Firmware version
IUFillText(&VersionInfoS[0], "VERSION_FIRMWARE", "Firmware", "Unknown");
IUFillTextVector(&VersionInfoSP, VersionInfoS, 1, getDeviceName(), "VERSION", "Version", INFO_TAB, IP_RO, 60, IPS_IDLE);

// Enable/Disable backlash
// IUFillSwitch(&BacklashCompensationS[BACKLASH_ENABLED], "Enable", "", ISS_OFF);
// IUFillSwitch(&BacklashCompensationS[BACKLASH_DISABLED], "Disable", "", ISS_ON);
Expand Down Expand Up @@ -258,6 +262,13 @@ bool ASIEAF::updateProperties()
// defineSwitch(&FocuserBacklashSP);
// defineNumber(&BacklashNP);

char firmware[12];
unsigned char major, minor, build;
EAFGetFirmwareVersion(m_ID, &major, &minor, &build);
snprintf(firmware, sizeof(firmware), "%d.%d.%d", major, minor, build);
IUSaveText(&VersionInfoS[0], firmware);
defineText(&VersionInfoSP);

GetFocusParams();

LOG_INFO("ASI EAF parameters updated, focuser ready for use.");
Expand All @@ -269,6 +280,7 @@ bool ASIEAF::updateProperties()
if (TemperatureNP.s != IPS_IDLE)
deleteProperty(TemperatureNP.name);
deleteProperty(BeepSP.name);
deleteProperty(VersionInfoSP.name);
// deleteProperty(FocuserBacklashSP.name);
// deleteProperty(BacklashNP.name);
}
Expand Down
3 changes: 3 additions & 0 deletions indi-asi/asi_focuser.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ class ASIEAF : public INDI::Focuser
BEEL_OFF
};

IText VersionInfoS[1] = {};
ITextVectorProperty VersionInfoSP;

// Enable/Disable backlash
// ISwitch BacklashCompensationS[2];
// ISwitchVectorProperty FocuserBacklashSP;
Expand Down