32 static std::unique_ptr<Rainbow> scope(
new Rainbow());
70 IUFillSwitchVector(&HomeSP, HomeS, 1,
getDeviceName(),
"HOME",
"Homing",
MAIN_CONTROL_TAB,
IP_RW,
ISR_ATMOST1, 60,
74 IUFillSwitch(&SaveAlignBeforeSyncS[STAR_ALIGNMENT_ENABLED],
"STAR_ALIGNMENT_ENABLED",
"Enabled",
ISS_OFF);
75 IUFillSwitch(&SaveAlignBeforeSyncS[STAR_ALIGNMENT_DISABLED],
"STAR_ALIGNMENT_DISABLED",
"Disabled",
ISS_ON);
80 IUFillText(&RSTVersionsT[FIRMWARE],
"FIRMWARE",
"Firmware Version",
"");
81 IUFillText(&RSTVersionsT[SERIALNUMBER],
"SERIALNUMBER",
"Serial Number",
"");
86 IUFillSwitch(&PullVoltTempS[PULL_VOLTTEMP_ENABLED],
"PULL_VOLTTEMP_ENABLED",
"Enabled",
ISS_OFF);
87 IUFillSwitch(&PullVoltTempS[PULL_VOLTTEMP_DISABLED],
"PULL_VOLTTEMP_DISABLED",
"Disabled",
ISS_ON);
92 IUFillNumber(&RSTVoltTempN[VOLTAGE],
"VOLTAGE",
"Input Voltage (V)",
"%2.1f", 0, 20., 0., 0.);
93 IUFillNumber(&RSTVoltTempN[BOARD_TEMPERATURE],
"BOARD_TEMPERATURE",
"Board Temp. (°C)",
"%2.1f", -50, 70., 0., 0.);
94 IUFillNumber(&RSTVoltTempN[RA_M_TEMPERATURE],
"RA_M_TEMPERATURE",
"RA-Motor Temp. (°C)",
"%2.1f", -50, 70., 0., 0.);
95 IUFillNumber(&RSTVoltTempN[DE_M_TEMPERATURE],
"DE_M_TEMPERATURE",
"DEC-Motor Temp. (°C)",
"%2.1f", -50, 70., 0., 0.);
101 IUFillNumber(&RSTMotorPowN[RA_M_POWER],
"RA_M_POWER",
"RA-Motor (%)",
"%3.1f", 0, 100., 0., 0.);
102 IUFillNumber(&RSTMotorPowN[DE_M_POWER],
"DE_M_POWER",
"DE-Motor (%)",
"%3.1f", 0, 100., 0., 0.);
118 IUFillNumber(&GuideRateN[0],
"GUIDE_RATE",
"x Sidereal",
"%g", 0.1, 1.0, 0.1, 0.5);
122 IUFillNumber(&SlewSpeedsN[SLEW_SPEED_MAX],
"SLEW_SPEED_MAX",
"Max (x Siderial)",
"%g", 0, 2000, 0, 0);
123 IUFillNumber(&SlewSpeedsN[SLEW_SPEED_FIND],
"SLEW_SPEED_FIND",
"Find (x Siderial)",
"%g", 0, 2000, 0, 0);
124 IUFillNumber(&SlewSpeedsN[SLEW_SPEED_CENTERING],
"SLEW_SPEED_CENTERING",
"Centering (x Siderial)",
"%g", 0, 2000, 0, 0);
190 if (!strcmp(name, HorizontalCoordsNP.
name))
193 double newAlt = -1, newAz = -1;
196 for (nset = i = 0; i < n; i++)
198 if (horp == &HorizontalCoordsN[
AXIS_ALT])
201 nset += newAlt >= -90. && newAlt <= 90.0;
203 else if (horp == &HorizontalCoordsN[
AXIS_AZ])
206 nset += newAz >= 0. && newAz <= 360.0;
212 if (slewToHorizontalCoords(newAz, newAlt))
223 LOG_ERROR(
"Failed to slew to target coordinates.");
230 IDSetNumber(&HorizontalCoordsNP,
"Altitude or Azimuth missing or invalid");
235 else if (!strcmp(name, GuideRateNP.
name))
241 LOGF_INFO(
"Guide rate updated to %.2fX sidereal rate.", values[0]);
250 else if (!strcmp(name, SlewSpeedsNP.
name))
253 if (setSlewSpeedVal(SLEW_SPEED_MAX, values[SLEW_SPEED_MAX])
254 && setSlewSpeedVal(SLEW_SPEED_FIND, values[SLEW_SPEED_FIND])
255 && setSlewSpeedVal(SLEW_SPEED_CENTERING, values[SLEW_SPEED_CENTERING])
283 if (!strcmp(HomeSP.
name, name))
287 LOG_WARN(
"Homing is already in progress.");
296 LOG_INFO(
"Mount is moving to home position...");
299 LOG_ERROR(
"Mount failed to move to home position.");
305 else if (!strcmp(SaveAlignBeforeSyncSP.
name, name))
309 SaveAlignBeforeSyncSP.
s =
IPS_OK;
315 else if (!strcmp(PullVoltTempSP.
name, name))
318 if (PullVoltTempS[PULL_VOLTTEMP_DISABLED].s ==
ISS_ON)
320 RSTVoltTempN[VOLTAGE].value = 0.;
321 RSTVoltTempN[BOARD_TEMPERATURE].value = 0.;
322 RSTVoltTempN[RA_M_TEMPERATURE].value = 0.;
323 RSTVoltTempN[DE_M_TEMPERATURE].value = 0.;
324 RSTMotorPowN[RA_M_POWER].value = 0.;
325 RSTMotorPowN[DE_M_POWER].value = 0.;
331 LOG_INFO(
"Pulling RST's Voltage and Temperatures set to: off");
336 LOG_INFO(
"Pulling RST's Voltage and Temperatures set to: on");
353 LOGF_INFO(
"Detected firmware %s", m_Version.c_str());
359 if (getSlewSpeedVal(SLEW_SPEED_MAX) && (getSlewSpeedVal(SLEW_SPEED_FIND) && getSlewSpeedVal(SLEW_SPEED_CENTERING)))
362 double longitude = 0, latitude = 90;
393 char cmd[DRIVER_LEN] = {0};
394 int degrees, minutes, seconds;
406 snprintf(
cmd, DRIVER_LEN,
":Sg%c%03d*%02d'%02d#", longitude >= 0 ?
'+' :
'-', std::abs(degrees), minutes, seconds);
413 snprintf(
cmd, DRIVER_LEN,
":St%c%02d*%02d'%02d#", latitude >= 0 ?
'+' :
'-', std::abs(degrees), minutes, seconds);
439 char res[DRIVER_LEN] = {0};
445 m_Version = std::string(res + 3);
450 char fw[16] = {0}, sn[16] = {0};
451 sscanf(res + 3,
"%6s", fw);
452 memset(res, 0,
sizeof res);
457 sscanf(res + 3,
"%6s", sn);
471 char cmd[DRIVER_LEN] = {0};
472 snprintf(
cmd, DRIVER_LEN,
":Ct%c#", enabled ?
'A' :
'L');
481 char res[DRIVER_LEN] = {0};
506 char cmd[DRIVER_LEN] = {0};
507 snprintf(
cmd, DRIVER_LEN,
":Cu0=%3.1f#", rate);
516 char res[DRIVER_LEN] = {0};
522 memcpy(rate, res + 5, 3);
524 GuideRateN[0].value = std::stod(rate);
532 bool Rainbow::setSlewSpeedVal(
int speedtype,
double rate)
534 char cmd[DRIVER_LEN] = {0};
535 snprintf(
cmd, DRIVER_LEN,
":Cu%d=%g#", speedtype == SLEW_SPEED_MAX ? 3 : (speedtype == SLEW_SPEED_FIND ? 2 : 1), rate);
536 LOGF_INFO(
"slew speed set to enum %d and value %g", speedtype, rate);
543 bool Rainbow::getSlewSpeedVal(
int speedtype)
545 char res[DRIVER_LEN] = {0};
547 char cmd[DRIVER_LEN] = {0};
548 snprintf(
cmd, DRIVER_LEN,
":CU%d#", speedtype == SLEW_SPEED_MAX ? 3 : (speedtype == SLEW_SPEED_FIND ? 2 : 1));
551 memcpy(rate, res + 5, 4);
552 SlewSpeedsN[speedtype].value = std::stod(rate);
591 if (slewToHorizontalCoords(parkAZ, parkAlt))
596 LOG_INFO(
"Parking is in progress...");
628 char res[DRIVER_LEN] = {0};
633 if (!strcmp(res,
":MM0#") || !strcmp(res,
":CHO#"))
638 else if (!strcmp(res,
":MML#"))
642 else if (!strcmp(res,
":MMU#"))
646 else if (!strcmp(res,
":MME#"))
650 else if (!strcmp(res,
":CH0#"))
654 else if (!strcmp(res,
":CH<#"))
682 LOG_INFO(
"Homing completed successfully.");
694 LOG_INFO(
"Slew is complete. Tracking...");
697 else if (m_SlewErrorCode > 0)
710 LOGF_ERROR(
"Homing error: %s", getSlewErrorString(m_SlewErrorCode).c_str());
716 LOGF_ERROR(
"Slewing error: %s", getSlewErrorString(m_SlewErrorCode).c_str());
728 else if (m_SlewErrorCode > 0)
734 LOGF_ERROR(
"Parking error: %s", getSlewErrorString(m_SlewErrorCode).c_str());
748 if (!getAZ() || !getAL())
754 HorizontalCoordsN[
AXIS_AZ].value = m_CurrentAZ;
755 HorizontalCoordsN[
AXIS_ALT].value = m_CurrentAL;
761 if (PullVoltTempS[PULL_VOLTTEMP_ENABLED].s ==
ISS_ON)
764 char res[DRIVER_LEN] = {0};
768 sscanf(res + 3,
"%f", &v);
769 memset(res, 0,
sizeof res);
770 RSTVoltTempN[VOLTAGE].value = v;
773 sscanf(res + 3,
"%f|%f|%f", &bT, &rT, &dT);
774 memset(res, 0,
sizeof res);
775 RSTVoltTempN[BOARD_TEMPERATURE].value = bT;
776 RSTVoltTempN[RA_M_TEMPERATURE].value = rT;
777 RSTVoltTempN[DE_M_TEMPERATURE].value = dT;
785 sscanf(res + 3,
"%f|%f", &dP, &rP);
786 memset(res, 0,
sizeof res);
787 RSTMotorPowN[RA_M_POWER].value = rP;
788 RSTMotorPowN[DE_M_POWER].value = dP;
800 const struct timespec timeout = {0, 100000000L};
802 char RAStr[64] = {0}, DecStr[64] = {0};
833 nanosleep(&timeout,
nullptr);
838 LOGF_ERROR(
"Error Slewing to JNow RA %s - DEC %s", RAStr, DecStr);
843 LOGF_INFO(
"Slewing to RA: %s - DE: %s", RAStr, DecStr);
857 char res[DRIVER_LEN] = {0};
862 return (
f_scansexa(res + 3, &m_CurrentRA) == 0);
870 char res[DRIVER_LEN] = {0};
875 return (
f_scansexa(res + 3, &m_CurrentDE) == 0);
884 char cmd[DRIVER_LEN] = {0};
885 char res[DRIVER_LEN] = {0};
886 int degrees, minutes;
891 snprintf(
cmd, DRIVER_LEN,
":Sr%02d:%02d:%04.1f#", degrees, minutes, seconds);
896 return res[0] ==
'1';
904 char cmd[DRIVER_LEN] = {0};
905 char res[DRIVER_LEN] = {0};
906 int degrees, minutes;
911 snprintf(
cmd, DRIVER_LEN,
":Sd%c%02d*%02d:%04.1f#", de >= 0 ?
'+' :
'-', std::abs(degrees), minutes, seconds);
916 return res[0] ==
'1';
929 char RAStr[16], DEStr[16];
932 LOGF_DEBUG(
"Slewing to RA (%s) DE (%s)...", RAStr, DEStr);
943 bool Rainbow::getAZ()
945 char res[DRIVER_LEN] = {0};
950 return (
f_scansexa(res + 3, &m_CurrentAZ) == 0);
956 bool Rainbow::getAL()
958 char res[DRIVER_LEN] = {0};
963 return (
f_scansexa(res + 3, &m_CurrentAL) == 0);
969 bool Rainbow::setAZ(
double azimuth)
971 char cmd[DRIVER_LEN] = {0};
972 int degrees, minutes;
977 snprintf(
cmd, DRIVER_LEN,
":Sz%03d*%02d:%04.1f#", degrees, minutes, seconds);
985 bool Rainbow::setAL(
double altitude)
987 char cmd[DRIVER_LEN] = {0};
988 int degrees, minutes;
993 snprintf(
cmd, DRIVER_LEN,
":Sa%c%02d*%02d:%04.1f#", degrees >= 0 ?
'+' :
'-', std::abs(degrees), minutes, seconds);
1001 bool Rainbow::slewToHorizontalCoords(
double azimuth,
double altitude)
1003 if (!setAZ(azimuth) || !setAL(altitude))
1008 char AzStr[16], AltStr[16];
1009 fs_sexa(AzStr, azimuth, 2, 36000);
1010 fs_sexa(AltStr, altitude, 2, 36000);
1011 LOGF_DEBUG(
"Slewing to Az (%s) Alt (%s)...", AzStr, AltStr);
1029 LOG_ERROR(
"Error setting N/S motion direction.");
1039 LOG_ERROR(
"Error stopping N/S motion.");
1060 LOG_ERROR(
"Error setting W/E motion direction.");
1070 LOG_ERROR(
"Error stopping W/E motion.");
1120 char cmd[DRIVER_LEN] = {0};
1121 if (SaveAlignBeforeSyncS[STAR_ALIGNMENT_ENABLED].s ==
ISS_ON)
1123 snprintf(
cmd, DRIVER_LEN,
":CN%07.3f%c%06.3f#",
ra * 15.0,
dec >= 0 ?
'+' :
'-', std::fabs(
dec));
1127 snprintf(
cmd, DRIVER_LEN,
":Ck%07.3f%c%06.3f#",
ra * 15.0,
dec >= 0 ?
'+' :
'-', std::fabs(
dec));
1132 char RAStr[64] = {0}, DecStr[64] = {0};
1135 LOGF_INFO(
"Synced to RA %s DE %s%s", RAStr, DecStr,
1136 SaveAlignBeforeSyncS[STAR_ALIGNMENT_ENABLED].s ==
ISS_ON ?
", and saved as alignment point." :
"");
1185 const std::string Rainbow::getSlewErrorString(uint8_t code)
1190 return "The altitude of the target is lower than lower limit.";
1192 return "The altitude of the target is higher than upper limit.";
1194 return "Slewing was canceled by user";
1196 return "RA Axis homing failed.";
1198 return "DE Axis homing failed.";
1201 return "Unknown error";
1243 char cmd[DRIVER_LEN] = {0};
1246 int* guideTID = &m_GuideNSTID;
1255 guideTID = &m_GuideNSTID;
1261 guideTID = &m_GuideNSTID;
1267 guideTID = &m_GuideWETID;
1273 guideTID = &m_GuideWETID;
1279 LOG_ERROR(
"Cannot guide while moving.");
1304 LOG_INFO(
"Tracking mode switched to guide.");
1318 snprintf(
cmd, DRIVER_LEN,
":M%c#", std::tolower(dc));
1369 char cmd[DRIVER_LEN] = {0};
1381 snprintf(
cmd, DRIVER_LEN,
":Q%c#", direction ==
North ?
'n' :
's');
1392 snprintf(
cmd, DRIVER_LEN,
":Q%c#", direction ==
East ?
'e' :
'w');
1396 LOGF_DEBUG(
"Guide %c finished",
"NSWE"[direction]);
1428 time_t now = time (
nullptr);
1429 strftime(timeString,
MAXINDINAME,
"%T", localtime(&now));
1434 char response[DRIVER_LEN] = {0};
1438 if (sscanf(response + 3,
"%d:%d:%d", &h, &m, &s) != 3)
1440 LOG_WARN(
"Failed to get time from device.");
1443 snprintf(timeString,
MAXINDINAME,
"%02d:%02d:%02d", h, m, s);
1456 time_t now = time (
nullptr);
1457 strftime(dateString,
MAXINDINAME,
"%F", localtime(&now));
1462 char response[DRIVER_LEN] = {0};
1463 char mell_prefix[3] = {0};
1467 if (sscanf(response + 3,
"%d%*c%d%*c%d", &mm, &dd, &yy) != 3)
1469 LOG_WARN(
"Failed to get date from device.");
1475 strncpy(mell_prefix,
"19", 3);
1477 strncpy(mell_prefix,
"20", 3);
1479 snprintf(dateString, 32,
"%s%02d-%02d-%02d", mell_prefix, yy, mm, dd);
1497 int rst135_utc_offset = 0;
1499 char response[DRIVER_LEN] = {0};
1503 if (sscanf(response + 3,
"%d", &rst135_utc_offset) != 1)
1505 LOG_WARN(
"Failed to get UTC offset from device.");
1510 *offset = rst135_utc_offset * -1;
1524 memset(<m, 0,
sizeof(ltm));
1525 memset(&utm, 0,
sizeof(utm));
1532 char utcStr[8] = {0};
1533 snprintf(utcStr, 8,
"%.2f", offset);
1538 LOG_WARN(
"Could not obtain UTC offset from mount!");
1544 LOG_WARN(
"Could not obtain local time from mount!");
1550 LOG_WARN(
"Could not obtain local date from mount!");
1556 snprintf(datetime,
MAXINDINAME,
"%sT%s", cdate, ctime);
1559 if (strptime(datetime,
"%FT%T", <m) ==
nullptr)
1561 LOGF_WARN(
"Could not process mount date and time: %s", datetime);
1567 time_epoch = mktime(<m);
1570 time_epoch -=
static_cast<int>(offset * 3600.0);
1573 localtime_r(&time_epoch, &utm);
1576 strftime(cdate,
MAXINDINAME,
"%Y-%m-%dT%H:%M:%S", &utm);
1594 double longitude {0}, latitude {0};
1595 double dd = 0, mm = 0, ssf = 0;
1596 char response[DRIVER_LEN] = {0};
1612 if (sscanf(response + 3,
"%lf%*[^0-9]%lf%*[^0-9]%lf", &dd, &mm, &ssf) != 3)
1614 LOG_WARN(
"Failed to get site latitude from device.");
1620 latitude = dd + mm / 60.0 + ssf / 3600.0;
1622 latitude = dd - mm / 60.0 - ssf / 3600.0;
1629 if (sscanf(response + 3,
"%lf%*[^0-9]%lf%*[^0-9]%lf", &dd, &mm, &ssf) != 3)
1631 LOG_WARN(
"Failed to get site longitude from device.");
1637 longitude = 360.0 - (dd + mm / 60.0 + ssf / 3600.0);
1639 longitude = (dd - mm / 60.0 - ssf / 3600.0) * -1.0;
1664 int nbytes_written = 0, nbytes_read = 0, rc = -1;
1666 tcflush(
PortFD, TCIOFLUSH);
1670 char hex_cmd[DRIVER_LEN * 3] = {0};
1679 char formatted_command[DRIVER_LEN] = {0};
1680 snprintf(formatted_command, DRIVER_LEN,
"%s\r",
cmd);
1688 LOGF_ERROR(
"Serial write error: %s.", errstr);
1696 rc =
tty_read(
PortFD, res, res_len, DRIVER_TIMEOUT, &nbytes_read);
1704 LOGF_ERROR(
"Serial read error: %s.", errstr);
1710 char hex_res[DRIVER_LEN * 3] = {0};
1711 hexDump(hex_res, res, res_len);
1717 res[nbytes_read - 1] = 0;
1721 tcflush(
PortFD, TCIOFLUSH);
1731 for (
int i = 0; i < size; i++)
1732 sprintf(buf + 3 * i,
"%02X ",
static_cast<uint8_t
>(data[i]));
1735 buf[3 * size - 1] =
'\0';
1741 std::vector<std::string>
Rainbow::split(
const std::string &input,
const std::string ®ex)
1744 std::regex re(regex);
1745 std::sregex_token_iterator
1746 first{input.begin(), input.end(), re, -1},
1748 return {first, last};
void setDefaultBaudRate(BaudRate newRate)
setDefaultBaudRate Set default baud rate. The default baud rate is 9600 unless otherwise changed by t...
const char * getDeviceName() const
virtual bool saveConfig(bool silent=false, const char *property=nullptr)
Save the current properties in a configuration file.
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)
bool isSimulation() const
void setDriverInterface(uint16_t value)
setInterface Set driver interface. By default the driver interface is set to GENERAL_DEVICE....
uint16_t getDriverInterface() const
void addDebugControl()
Add Debug control to the driver.
INumberVectorProperty GuideNSNP
void initGuiderProperties(const char *deviceName, const char *groupName)
Initilize guider properties. It is recommended to call this function within initProperties() of your ...
INumberVectorProperty GuideWENP
void processGuiderProperties(const char *name, double values[], char *names[], int n)
Call this function whenever client updates GuideNSNP or GuideWSP properties in the primary device....
TelescopeStatus TrackState
ISwitchVectorProperty TrackStateSP
void SetAxis1Park(double value)
SetRAPark Set current RA/AZ parking position. The data park file (stored in ~/.indi/ParkData....
ISwitchVectorProperty MovementNSSP
ISwitchVectorProperty AbortSP
void SetAxis1ParkDefault(double steps)
SetRAPark Set default RA/AZ parking position.
void SetTelescopeCapability(uint32_t cap, uint8_t slewRateCount)
SetTelescopeCapability sets the Telescope capabilities. All capabilities must be initialized.
INumberVectorProperty LocationNP
virtual bool initProperties() override
Called to initialize basic properties required all the time.
ITextVectorProperty TimeTP
double GetAxis1Park() const
double GetAxis2Park() const
virtual int AddTrackMode(const char *name, const char *label, bool isDefault=false)
AddTrackMode.
ISwitchVectorProperty TrackModeSP
ISwitchVectorProperty SlewRateSP
Connection::Serial * serialConnection
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual void SetParked(bool isparked)
SetParked Change the mount parking status. The data park file (stored in ~/.indi/ParkData....
INumberVectorProperty EqNP
@ TELESCOPE_HAS_TRACK_MODE
@ TELESCOPE_HAS_PIER_SIDE_SIMULATION
@ TELESCOPE_CAN_CONTROL_TRACK
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
void NewRaDec(double ra, double dec)
The child class calls this function when it has updates.
bool InitPark()
InitPark Loads parking data (stored in ~/.indi/ParkData.xml) that contains parking status and parking...
ISwitchVectorProperty MovementWESP
void SetAxis2Park(double steps)
SetDEPark Set current DEC/ALT parking position. The data park file (stored in ~/.indi/ParkData....
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
void SetParkDataType(TelescopeParkData type)
setParkDataType Sets the type of parking data stored in the park data file and presented to the user.
void SetAxis2ParkDefault(double steps)
SetDEParkDefault Set default DEC/ALT parking position.
virtual bool Sync(double ra, double dec) override
Sync.
virtual IPState GuideNorth(uint32_t ms) override
Guiding.
void guideTimeout(Direction direction)
Guide Timeout.
static void guideTimeoutHelperN(void *p)
Guide Timeout North.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool Goto(double ra, double dec) override
Slew RA/DE.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool SetSlewRate(int index) override
Set Slew Rate.
virtual IPState GuideEast(uint32_t ms) override
Guide East.
virtual bool SetTrackMode(uint8_t mode) override
Set Track Mode.
virtual IPState GuideWest(uint32_t ms) override
Guide West.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Abort.
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
Location & Time.
virtual bool SetTrackEnabled(bool enabled) override
Tracking Functions.
void getStartupStatus()
Query Functions.
void hexDump(char *buf, const char *data, int size)
bool getFirmwareVersion()
const char * getDefaultName() override
virtual bool Park() override
Parking & Homing.
virtual bool Handshake() override
perform handshake with device to check communication
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
bool sendScopeLocation()
Get Location from mount.
bool sendScopeTime()
Location & Time.
static void guideTimeoutHelperS(void *p)
Guide Timeout South.
bool getLocalDate(char *dateString)
Get Date from mount.
bool sendCommand(const char *cmd, char *res=nullptr, int cmd_len=-1, int res_len=-1)
Communication Functions.
IPState guide(Direction direction, uint32_t ms)
Guide universal function.
static void guideTimeoutHelperW(void *p)
Guide Timeout West.
std::vector< std::string > split(const std::string &input, const std::string ®ex)
static void guideTimeoutHelperE(void *p)
Guide Timeout East.
virtual bool UnPark() override
Unparking.
bool setRA(double ra)
Set Target RA.
bool getLocalTime(char *timeString)
Get Time from mount.
void addGuideTimer(Direction direction, uint32_t ms)
Add guide timer.
bool getUTFOffset(double *offset)
GET UTC offset from mount.
bool setDE(double de)
Set Target Altitude.
virtual IPState GuideSouth(uint32_t ms) override
Guide South.
virtual bool Abort() override
Abort.
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
W/E Motion.
bool slewToEquatorialCoords(double ra, double de)
Slew to Equatorial Coordinates.
virtual bool isSlewComplete()
Motion Functions.
bool setGuideRate(double rate)
virtual bool ReadScopeStatus() override
Read telescope status.
Class to provide general functionality of a telescope device.
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
const char * MOTION_TAB
MOTION_TAB Where all the motion control properties of the device are located.
void IERmTimer(int timerid)
Remove the timer with the given timerid, as returned from IEAddTimer() or IEAddPeriodicTimer().
int IEAddTimer(int millisecs, IE_TCF *fp, void *p)
Register a new single-shot timer function, fp, to be called with ud as argument after ms.
void getSexComponentsIID(double value, int *d, int *m, double *s)
int f_scansexa(const char *str0, double *dp)
convert sexagesimal string str AxBxC to double. x can be anything non-numeric. Any missing A,...
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 fs_sexa(char *out, double a, int w, int fracbase)
Converts a sexagesimal number to a string. sprint the variable a in sexagesimal format into out[].
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.
void IUFillNumberVector(INumberVectorProperty *nvp, INumber *np, int nnp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a number vector property. The vector's auxiliary elements will be set to NULL.
int IUFindOnSwitchIndex(const ISwitchVectorProperty *svp)
Returns the index of first ON switch it finds in the vector switch property.
void IUResetSwitch(ISwitchVectorProperty *svp)
Reset all switches in a switch vector property to OFF.
void IUFillTextVector(ITextVectorProperty *tvp, IText *tp, int ntp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a text vector property. The vector's auxiliary elements will be set to NULL.
void IUSaveText(IText *tp, const char *newtext)
Function to reliably save new text in a IText.
void IUFillSwitch(ISwitch *sp, const char *name, const char *label, ISState s)
Assign attributes for a switch property. The switch's auxiliary elements will be set to NULL.
void IUFillText(IText *tp, const char *name, const char *label, const char *initialText)
Assign attributes for a text property. The text's auxiliary elements will be set to NULL.
void IUFillNumber(INumber *np, const char *name, const char *label, const char *format, double min, double max, double step, double value)
Assign attributes for a number property. The number's auxiliary elements will be set to NULL.
void IUFillSwitchVector(ISwitchVectorProperty *svp, ISwitch *sp, int nsp, const char *dev, const char *name, const char *label, const char *group, IPerm p, ISRule r, double timeout, IPState s)
Assign attributes for a switch vector property. The vector's auxiliary elements will be set to NULL.
int IUUpdateSwitch(ISwitchVectorProperty *svp, ISState *states, char *names[], int n)
Update all switches in a switch vector property.
void IDSetNumber(const INumberVectorProperty *nvp, const char *fmt,...)
void IDSetSwitch(const ISwitchVectorProperty *svp, const char *fmt,...)
int IUGetConfigNumber(const char *dev, const char *property, const char *member, double *value)
IUGetConfigNumber Opens configuration file and reads single number property.
int IUUpdateNumber(INumberVectorProperty *nvp, double values[], char *names[], int n)
Update all numbers in a number vector property.
void IDSetText(const ITextVectorProperty *tvp, const char *fmt,...)
#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,...)
Namespace to encapsulate INDI client, drivers, and mediator classes.
Switch vector property descriptor.