27#include <libnova/transform.h>
106 GuideRateNP[0].fill(
"RATE",
"Rate",
"%.2f", 0.1, 0.9, 0.1, 0.5);
111 BuzzerSP[Off].fill(
"OFF",
"Off",
ISS_OFF);
112 BuzzerSP[Low].fill(
"LOW",
"Low",
ISS_OFF);
113 BuzzerSP[High].fill(
"HIGH",
"High",
ISS_ON);
125 MeridianFlipSP.load();
128 PostMeridianTrackSP[TRACK].fill(
"TRACK",
"Track",
ISS_ON);
129 PostMeridianTrackSP[STOP].fill(
"STOP",
"Stop",
ISS_OFF);
132 PostMeridianTrackSP.load();
135 MeridianLimitNP[0].fill(
"LIMIT",
"Limit (deg)",
"%.f", -15, 15, 1, 0);
137 MeridianLimitNP.load();
142 AltitudeLimitSP.fill(
getDeviceName(),
"ALTITUDE_LIMIT_CONTROL",
"Altitude Limit Control", ALTITUDE_LIMIT_TAB,
IP_RW,
145 AltitudeLimitUpperNP[0].fill(
"UPPER_LIMIT",
"Upper Limit (deg)",
"%.f", 60, 90, 1, 90);
146 AltitudeLimitUpperNP.fill(
getDeviceName(),
"ALTITUDE_UPPER_LIMIT",
"Altitude Upper Limit", ALTITUDE_LIMIT_TAB,
IP_RW, 60,
149 AltitudeLimitLowerNP[0].fill(
"LOWER_LIMIT",
"Lower Limit (deg)",
"%.f", 0, 30, 1, 0);
150 AltitudeLimitLowerNP.fill(
getDeviceName(),
"ALTITUDE_LOWER_LIMIT",
"Altitude Lower Limit", ALTITUDE_LIMIT_TAB,
IP_RW, 60,
154 MultiStarAlignSP[CLEAR_ALIGNMENT_DATA].fill(
"CLEAR",
"Clear Data",
ISS_OFF);
159 VariableSlewRateNP[0].fill(
"RATE",
"Rate (x Sidereal)",
"%.2f", 0.00, 1440.00, 0.01, 1440.00);
163 FirmwareTP[FIRMWARE_MODEL].fill(
"MODEL",
"Model",
"");
164 FirmwareTP[FIRMWARE_VERSION].fill(
"VERSION",
"Version",
"");
168 CustomParkSP[0].fill(
"SET",
"Set",
ISS_OFF);
260 for (
int i = 0; i < 2; i++)
265 const struct timespec ms250_delay = {.tv_sec = 0, .tv_nsec = 250000000};
266 nanosleep(&ms250_delay, NULL);
275void LX200AM5::setup()
288 getMeridianFlipSettings();
291 getAltitudeLimitStatus();
292 getAltitudeLimitUpper();
293 getAltitudeLimitLower();
296 checkMountParkState();
307 if (BuzzerSP.isNameMatch(name))
311 if (BuzzerSP[Off].isNameMatch(names[0]))
312 return setBuzzer(Off);
313 if (BuzzerSP[Low].isNameMatch(names[0]))
314 return setBuzzer(Low);
315 if (BuzzerSP[High].isNameMatch(names[0]))
316 return setBuzzer(High);
322 if (HeavyDutyModeSP.isNameMatch(name))
324 return updateProperty(HeavyDutyModeSP, states, names,
n, [
this, names]()
326 return setHeavyDutyMode(HeavyDutyModeSP[
INDI_ENABLED].isNameMatch(names[0]));
331 if (MeridianFlipSP.isNameMatch(name))
333 return updateProperty(MeridianFlipSP, states, names,
n, [
this, names]()
335 return setMeridianFlipSettings(MeridianFlipSP[
INDI_ENABLED].isNameMatch(names[0]),
336 PostMeridianTrackSP[TRACK].getState() ==
ISS_ON,
337 MeridianLimitNP[0].getValue());
342 if (PostMeridianTrackSP.isNameMatch(name))
344 return updateProperty(PostMeridianTrackSP, states, names,
n, [
this, names]()
347 PostMeridianTrackSP[TRACK].isNameMatch(names[0]),
348 MeridianLimitNP[0].getValue());
353 if (CustomParkSP.isNameMatch(name))
355 CustomParkSP.update(states, names,
n);
360 if (AltitudeLimitSP.isNameMatch(name))
362 return updateProperty(AltitudeLimitSP, states, names,
n, [
this, names]()
364 return setAltitudeLimitEnabled(AltitudeLimitSP[
INDI_ENABLED].isNameMatch(names[0]));
369 if (MultiStarAlignSP.isNameMatch(name))
371 MultiStarAlignSP.update(states, names,
n);
372 if (MultiStarAlignSP[CLEAR_ALIGNMENT_DATA].getState() ==
ISS_ON)
374 MultiStarAlignSP.setState(clearMultiStarAlignmentData() ?
IPS_OK :
IPS_ALERT);
378 MultiStarAlignSP.setState(
IPS_IDLE);
380 MultiStarAlignSP.apply();
396 if (GuideRateNP.isNameMatch(name))
400 return setGuideRate(values[0]);
405 if (MeridianLimitNP.isNameMatch(name))
407 return updateProperty(MeridianLimitNP, values, names,
n, [
this, values]()
410 PostMeridianTrackSP[TRACK].getState() ==
ISS_ON,
416 if (AltitudeLimitUpperNP.isNameMatch(name))
418 return updateProperty(AltitudeLimitUpperNP, values, names,
n, [
this, values]()
420 return setAltitudeLimitUpper(values[0]);
425 if (AltitudeLimitLowerNP.isNameMatch(name))
427 return updateProperty(AltitudeLimitLowerNP, values, names,
n, [
this, values]()
429 return setAltitudeLimitLower(values[0]);
434 if (VariableSlewRateNP.isNameMatch(name))
436 return updateProperty(VariableSlewRateNP, values, names,
n, [
this, values]()
438 return setVariableSlewRate(values[0]);
453 LOG_ERROR(
"AM5 supports Alt-Az and German equatorial modes only.");
464 LOG_WARN(
"You must restart mount for change to take effect.");
471bool LX200AM5::readMountType()
473 char response[DRIVER_LEN] = {0};
474 if (!sendCommand(
":GU#", response))
477 if (strchr(response,
'Z'))
479 else if (strchr(response,
'G'))
489 char command[DRIVER_LEN] = {0};
490 snprintf(command, DRIVER_LEN,
":R%d#", index);
491 return sendCommand(command);
499bool LX200AM5::setGuideRate(
double value)
501 char command[DRIVER_LEN] = {0};
502 snprintf(command, DRIVER_LEN,
":Rg%.2f#", value);
503 return sendCommand(command);
509bool LX200AM5::getGuideRate()
511 char response[DRIVER_LEN] = {0};
512 if (sendCommand(
":Ggr#", response))
515 int result = sscanf(response,
"%f", &rate);
518 GuideRateNP[0].setValue(rate);
531bool LX200AM5::getTrackMode()
533 char response[DRIVER_LEN] = {0};
534 if (sendCommand(
":GT#", response))
537 auto onIndex = response[0] - 0x30;
538 if (onIndex >= 0 && onIndex <
static_cast<int>(
TrackModeSP.count()))
553bool LX200AM5::setBuzzer(
int value)
555 char command[DRIVER_LEN] = {0};
556 snprintf(command, DRIVER_LEN,
":SBu%d#", value);
557 return sendCommand(command);
563bool LX200AM5::getBuzzer()
565 char response[DRIVER_LEN] = {0};
566 if (sendCommand(
":GBu#", response))
569 auto onIndex = response[0] - 0x30;
570 if (onIndex >= 0 && onIndex <
static_cast<int>(BuzzerSP.count()))
572 BuzzerSP[onIndex].setState(
ISS_ON);
573 BuzzerSP.setState(
IPS_OK);
586bool LX200AM5::getHeavyDutyMode()
588 char response[DRIVER_LEN] = {0};
589 if (sendCommand(
":GRl#", response))
591 HeavyDutyModeSP.reset();
593 if (strcmp(response,
"1440#") == 0)
598 if (strcmp(response,
"720#") == 0)
603 HeavyDutyModeSP.setState(
IPS_OK);
616bool LX200AM5::setHeavyDutyMode(
bool enable)
619 char response[DRIVER_LEN] = {0};
620 return sendCommand(enable ?
":SRl720#" :
":SRl1440#", response, -1, 1) && response[0] ==
'1';
626bool LX200AM5::setMeridianFlipSettings(
bool enabled,
bool track,
double limit)
628 char command[DRIVER_LEN] = {0};
629 snprintf(command, DRIVER_LEN,
":STa%d%d%c%02d#", enabled ? 1 : 0, track ? 1 : 0,
630 limit >= 0 ?
'+' :
'-',
static_cast<int>(std::abs(limit)));
631 char response[2] = {0};
632 auto rc = sendCommand(command, response, -1, 1);
633 return rc && response[0] ==
'1';
639bool LX200AM5::getMeridianFlipSettings()
641 char response[DRIVER_LEN] = {0};
642 if (sendCommand(
":GTa#", response))
644 if (strlen(response) >= 5)
647 MeridianFlipSP.reset();
649 MeridianFlipSP.setState(
IPS_OK);
652 PostMeridianTrackSP.reset();
653 PostMeridianTrackSP[response[1] ==
'1' ? TRACK : STOP].setState(
ISS_ON);
654 PostMeridianTrackSP.setState(
IPS_OK);
657 char *sign = &response[2];
658 char *limit = &response[3];
659 int limitValue = atoi(limit);
661 limitValue = -limitValue;
662 MeridianLimitNP[0].setValue(limitValue);
663 MeridianLimitNP.setState(
IPS_OK);
678bool LX200AM5::setAltitudeLimitEnabled(
bool enable)
681 char response[DRIVER_LEN] = {0};
682 return sendCommand(enable ?
":SLE#" :
":SLD#", response, -1, 1) && response[0] ==
'1';
688bool LX200AM5::getAltitudeLimitStatus()
690 char response[DRIVER_LEN] = {0};
691 if (sendCommand(
":GLC#", response))
693 AltitudeLimitSP.reset();
695 AltitudeLimitSP.setState(
IPS_OK);
705bool LX200AM5::setAltitudeLimitUpper(
double limit)
707 char command[DRIVER_LEN] = {0};
708 snprintf(command, DRIVER_LEN,
":SLH%02d#",
static_cast<int>(limit));
709 char response[2] = {0};
710 auto rc = sendCommand(command, response, -1, 1);
711 return rc && response[0] ==
'1';
717bool LX200AM5::getAltitudeLimitUpper()
719 char response[DRIVER_LEN] = {0};
720 if (sendCommand(
":GLH#", response))
723 if (sscanf(response,
"%d#", &limit) == 1)
725 AltitudeLimitUpperNP[0].setValue(limit);
726 AltitudeLimitUpperNP.setState(
IPS_OK);
730 AltitudeLimitUpperNP.setState(
IPS_ALERT);
737bool LX200AM5::setAltitudeLimitLower(
double limit)
739 char command[DRIVER_LEN] = {0};
740 snprintf(command, DRIVER_LEN,
":SLL%02d#",
static_cast<int>(limit));
741 char response[2] = {0};
742 auto rc = sendCommand(command, response, -1, 1);
743 return rc && response[0] ==
'1';
749bool LX200AM5::getAltitudeLimitLower()
751 char response[DRIVER_LEN] = {0};
752 if (sendCommand(
":GLL#", response))
755 if (sscanf(response,
"%d#", &limit) == 1)
757 AltitudeLimitLowerNP[0].setValue(limit);
758 AltitudeLimitLowerNP.setState(
IPS_OK);
762 AltitudeLimitLowerNP.setState(
IPS_ALERT);
769bool LX200AM5::clearMultiStarAlignmentData()
771 char response[2] = {0};
772 auto rc = sendCommand(
":NSC#", response, -1, 1);
773 return rc && response[0] ==
'1';
779bool LX200AM5::setVariableSlewRate(
double rate)
781 char command[DRIVER_LEN] = {0};
782 snprintf(command, DRIVER_LEN,
":Rv%.2f#", rate);
783 return sendCommand(command);
791 int h {0}, m {0}, s {0};
792 char command[DRIVER_LEN] = {0};
796 snprintf(command, DRIVER_LEN,
":SG%c%02d:%02d#", offset >= 0 ?
'+' :
'-', std::abs(h), m);
802 char command[DRIVER_LEN] = {0};
803 snprintf(command, DRIVER_LEN,
":SC%02d/%02d/%02d#", months, days, years % 100);
812 char response[DRIVER_LEN] = {0};
813 bool rc = sendCommand(enabled ?
":Te#" :
":Td#", response, 4, 1);
814 return rc && response[0] ==
'1';
820bool LX200AM5::isTracking()
822 char response[DRIVER_LEN] = {0};
823 bool rc = sendCommand(
":GAT#", response);
824 return rc && response[0] ==
'1';
830bool LX200AM5::goHome()
832 return sendCommand(
":hC#");
852bool LX200AM5::setHome()
854 const char cmd[] =
":SOa#";
856 return sendCommand(
cmd, &status, strlen(
cmd),
sizeof(status)) && status ==
'1';
865 int d{0}, m{0}, s{0};
870 longitude = longitude - 360;
872 char command[DRIVER_LEN] = {0};
876 snprintf(command, DRIVER_LEN,
":Sg%c%03d*%02d:%02d#", longitude >= 0 ?
'+' :
'-', std::abs(d), m, s);
879 LOG_ERROR(
"Error setting site longitude coordinates");
884 snprintf(command, DRIVER_LEN,
":St%c%02d*%02d:%02d#", latitude >= 0 ?
'+' :
'-', std::abs(d), m, s);
887 LOG_ERROR(
"Error setting site latitude coordinates");
899 m_MountParking =
false;
903 if (hasCustomParkPosition() && CustomParkSP[0].getState() ==
ISS_ON)
904 rc = parkToMountPosition();
921 char response[DRIVER_LEN] = {0};
922 if (!sendStatusCommand(
":Spu#", response))
928 if (response[0] !=
'1')
932 if (!getMountParkState(state) || state !=
'0')
934 LOGF_ERROR(
"Mount refused to unpark (%s).", response);
950 if (!hasCustomParkPosition())
952 LOGF_WARN(
"Setting the park position requires mount firmware 1.3.0 or later (detected %s).",
953 FirmwareTP[FIRMWARE_VERSION].
getText());
957 char response[DRIVER_LEN] = {0};
958 if (!sendStatusCommand(
":Sp01#", response))
960 LOG_ERROR(
"Failed to set park position.");
967 LOG_INFO(
"Current position is stored as the mount park position.");
970 LOG_INFO(
"Current position is already the mount park position.");
973 LOG_ERROR(
"Mount refused the park position: only one park position can be set.");
976 LOG_ERROR(
"Mount refused the park position: only available in equatorial mode.");
979 LOG_ERROR(
"Mount refused the park position: the mount has to be homed first.");
982 LOG_ERROR(
"Mount refused the park position: the mount is moving.");
985 LOGF_ERROR(
"Mount refused the park position (%s).", response);
990 CustomParkSP[0].setState(
ISS_ON);
1001 CustomParkSP[0].setState(
ISS_OFF);
1004 LOG_INFO(
"Mount parks at the home position.");
1011bool LX200AM5::parkToMountPosition()
1013 char status[DRIVER_LEN] = {0};
1014 if (!sendCommand(
":GU#", status))
1017 if (strchr(status,
'Z'))
1019 LOG_ERROR(
"Parking to the mount park position is only available in equatorial mode.");
1025 LOG_ERROR(
"Failed to stop tracking before parking.");
1029 m_ParkMoved =
false;
1030 m_ParkDeadline = std::chrono::steady_clock::now() + PARK_START_TIMEOUT;
1032 LOG_INFO(
"Parking to the mount park position...");
1033 m_MountParking = sendCommand(
":hP#");
1034 return m_MountParking;
1040bool LX200AM5::getMountParkState(
char &state)
1042 char response[DRIVER_LEN] = {0};
1043 if (!sendCommand(
":Gps#", response))
1046 state = response[0];
1053void LX200AM5::checkMountParkState()
1055 m_MountParking =
false;
1058 if (!hasMountPark() || !getMountParkState(state))
1063 LOG_INFO(
"Mount reports it is parked.");
1066 else if (state ==
'1')
1070 m_MountParking =
true;
1080void LX200AM5::updateMountPark(
bool slewComplete)
1082 const bool slewing = !slewComplete;
1083 const bool timedOut = std::chrono::steady_clock::now() > m_ParkDeadline;
1087 if (!getMountParkState(state))
1093 m_MountParking =
false;
1104 else if (!m_ParkMoved && timedOut)
1105 failMountPark(
"mount did not start moving to the park position");
1109 failMountPark(
"mount reported a park error");
1117void LX200AM5::failMountPark(
const char *reason)
1120 m_MountParking =
false;
1136 bool slewComplete =
false, isHome =
false;
1137 char status[DRIVER_LEN] = {0};
1138 if (sendCommand(
":GU#", status))
1140 slewComplete = strchr(status,
'N');
1141 isHome = strchr(status,
'H');
1158 LOG_INFO(
"Slew is complete. Tracking...");
1164 updateMountPark(slewComplete);
1165 else if (slewComplete)
1172 auto nowTracking = isTracking();
1173 if (wasTracking != nowTracking)
1187 char response[DRIVER_LEN] = {0};
1188 if (sendCommand(
":Gm#", response))
1190 if (response[0] ==
'W')
1192 else if (response[0] ==
'E')
1207void LX200AM5::getFirmwareInfo()
1209 m_FirmwareVersion = 0;
1211 char response[DRIVER_LEN] = {0};
1212 if (sendCommand(
":GVP#", response))
1214 char *term = strchr(response, DRIVER_STOP_CHAR);
1217 FirmwareTP[FIRMWARE_MODEL].setText(response);
1220 memset(response, 0,
sizeof(response));
1221 if (sendCommand(
":GV#", response))
1223 char *term = strchr(response, DRIVER_STOP_CHAR);
1226 FirmwareTP[FIRMWARE_VERSION].setText(response);
1228 int major = 0, minor = 0, patch = 0;
1229 if (sscanf(response,
"%d.%d.%d", &major, &minor, &patch) == 3)
1230 m_FirmwareVersion = (major << 16) | (minor << 8) | patch;
1232 LOGF_WARN(
"Unexpected firmware version format: %s", response);
1237 LOGF_INFO(
"Mount %s firmware %s.", FirmwareTP[FIRMWARE_MODEL].
getText(), FirmwareTP[FIRMWARE_VERSION].
getText());
1238 if (!hasCustomParkPosition())
1239 LOG_INFO(
"Mount parks at the home position. Custom park position requires firmware 1.3.0 or later.");
1240 else if (CustomParkSP[0].getState() ==
ISS_ON)
1241 LOG_INFO(
"Mount parks at the custom park position.");
1243 LOG_INFO(
"Mount parks at the home position. To use a custom park position, slew to it and set it as current park position.");
1249bool LX200AM5::sendStatusCommand(
const char *
cmd,
char * res)
1251 int nbytes_written = 0, nbytes_read = 0;
1253 tcflush(
PortFD, TCIOFLUSH);
1260 if (rc ==
TTY_OK && res[0] ==
'e')
1271 char *term = strchr(res, DRIVER_STOP_CHAR);
1274 else if (res[0] !=
'e')
1279 tcflush(
PortFD, TCIOFLUSH);
1287bool LX200AM5::sendCommand(
const char *
cmd,
char * res,
int cmd_len,
int res_len)
1289 int nbytes_written = 0, nbytes_read = 0, rc = -1;
1291 tcflush(
PortFD, TCIOFLUSH);
1295 char hex_cmd[DRIVER_LEN * 3] = {0};
1296 hexDump(hex_cmd,
cmd, cmd_len);
1310 LOGF_ERROR(
"Serial write error: %s.", errstr);
1321 rc =
tty_read(
PortFD, res, res_len, DRIVER_TIMEOUT, &nbytes_read);
1329 LOGF_ERROR(
"Serial read error: %s.", errstr);
1335 char hex_res[DRIVER_LEN * 3] = {0};
1336 hexDump(hex_res, res, res_len);
1344 tcflush(
PortFD, TCIOFLUSH);
1366 LOG_WARN(
"Setting home position is not supported by the ZWO AM5 protocol.");
1371 LOG_WARN(
"Finding home position is not supported by the ZWO AM5 protocol.");
1382void LX200AM5::hexDump(
char * buf,
const char * data,
int size)
1384 for (
int i = 0; i < size; i++)
1385 sprintf(buf + 3 * i,
"%02X ",
static_cast<uint8_t
>(data[i]));
1388 buf[3 * size - 1] =
'\0';
1394std::vector<std::string> LX200AM5::split(
const std::string &input,
const std::string ®ex)
1397 std::regex re(regex);
1398 std::sregex_token_iterator
1399 first{input.begin(), input.end(), re, -1},
1401 return {first, last};
1411 GuideRateNP.save(fp);
1413 HeavyDutyModeSP.save(fp);
1414 MeridianFlipSP.save(fp);
1415 PostMeridianTrackSP.save(fp);
1416 MeridianLimitNP.save(fp);
1417 AltitudeLimitSP.save(fp);
1418 AltitudeLimitUpperNP.save(fp);
1419 AltitudeLimitLowerNP.save(fp);
1420 VariableSlewRateNP.save(fp);
1421 CustomParkSP.save(fp);
INDI::PropertyText getText(const char *name) const
bool updateProperty(PropertyType &property, ValueType *values, char *names[], int n, std::function< bool()> updater, bool saveConfig=false)
Generic helper function to update an INDI property based on an external operation.
virtual bool saveConfig(bool silent=false, const char *property=nullptr)
Save the current properties in a configuration file.
void setActiveConnection(Connection::Interface *existingConnection)
setActiveConnection Switch the active connection to the passed connection plugin
void setVersion(uint16_t vMajor, uint16_t vMinor)
Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
void defineProperty(INumberVectorProperty *property)
TelescopeStatus TrackState
TelescopeMountType getMountType() const
void SetTelescopeCapability(uint32_t cap, uint8_t slewRateCount)
SetTelescopeCapability sets the Telescope capabilities. All capabilities must be initialized.
bool isParked()
isParked is mount currently parked?
virtual void SetParked(bool isparked)
SetParked Change the mount parking status. The data park file (stored in ~/.indi/ParkData....
Connection::TCP * tcpConnection
TelescopeMountType
Mount geometry reported in the standard TELESCOPE_MOUNT_TYPE property. The values are the indices of ...
uint32_t GetTelescopeCapability() const
GetTelescopeCapability returns the capability of the Telescope.
void NewRaDec(double ra, double dec)
The child class calls this function when it has updates.
void setPierSide(TelescopePierSide side)
bool InitPark()
InitPark Loads parking data (stored in ~/.indi/ParkData.xml) that contains parking status and parking...
void setMountType(TelescopeMountType type)
setMountType Report the mount type in TELESCOPE_MOUNT_TYPE. Drivers call it when the type is fixed by...
void SetParkDataType(TelescopeParkData type)
setParkDataType Sets the type of parking data stored in the park data file and presented to the user.
@ TELESCOPE_HAS_PIER_SIDE
@ TELESCOPE_CAN_SET_MOUNT_TYPE
@ TELESCOPE_HAS_TRACK_MODE
@ TELESCOPE_CAN_CONTROL_TRACK
virtual bool ReadScopeStatus() override
Read telescope status.
virtual IPState ExecuteHomeAction(TelescopeHomeAction action) override
Execute a homing action.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool SetMountType(TelescopeMountType type) override
SetMountType Called when the user selects a different mount type in TELESCOPE_MOUNT_TYPE....
virtual bool SetDefaultPark() override
virtual bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool Park() override
Park the telescope to its home position.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual const char * getDefaultName() override
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool checkConnection() override
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual bool setUTCOffset(double offset) override
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
virtual bool SetSlewRate(int index) override
SetSlewRate Set desired slew rate index.
virtual bool setLocalDate(uint8_t days, uint8_t months, uint16_t years) override
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
void setLX200Capability(uint32_t cap)
@ LX200_HAS_PULSE_GUIDING
const char * INFO_TAB
INFO_TAB Where all the properties for general information are located.
const char * MOTION_TAB
MOTION_TAB Where all the motion control properties of the device are located.
const char * SITE_TAB
SITE_TAB Where all site information setting are located.
const char * OPTIONS_TAB
OPTIONS_TAB Where all the driver's options are located. Those may include auxiliary controls,...
INDI::PropertySwitch ParkSP
INDI::PropertyNumber EqNP
INDI::PropertySwitch TrackStateSP
INDI::PropertySwitch HomeSP
INDI::PropertySwitch SlewRateSP
INDI::PropertySwitch TrackModeSP
INDI::PropertySwitch MountTypeSP
Standard TELESCOPE_MOUNT_TYPE property, indexed by TelescopeMountType. Writable if the driver sets TE...
int tty_write(int fd, const char *buf, int nbytes, int *nbytes_written)
Writes a buffer to fd.
void getSexComponents(double value, int *d, int *m, int *s)
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.
int tty_nread_section(int fd, char *buf, int nsize, char stop_char, int timeout, int *nbytes_read)
read buffer from terminal with a delimiter
Implementations for common driver routines.
int IUGetConfigOnSwitchIndex(const char *dev, const char *property, int *index)
IUGetConfigOnSwitchIndex Opens configuration file and reads single switch property to find ON switch ...
*brief user defined string literal for JSON values *sa std::size_t n
#define LOGF_INFO(fmt,...)
#define LOGF_WARN(fmt,...)
#define LOGF_DEBUG(fmt,...)
#define LOG_ERROR(txt)
Shorter logging macros. In order to use these macros, the function (or method) "getDeviceName()" must...
#define LOGF_ERROR(fmt,...)
int setStandardProcedure(int fd, const char *data)
#define getLX200DEC(fd, x)
#define getLX200RA(fd, x)