28 #define SKYCOMMANDER_TIMEOUT 3
40 return (
const char *)
"SkyCommander";
50 char CR[1] = { 0x0D };
51 int rc = 0, nbytes_read = 0, nbytes_written = 0;
61 LOGF_ERROR(
"Error writing to SkyCommander %s (%d)", errmsg, rc);
70 LOGF_ERROR(
"Error reading from SkyCommander %s (%d)", errmsg, rc);
76 float RA = 0.0, DEC = 0.0;
77 nbytes_read = sscanf(coords,
" %g %g", &RA, &DEC);
81 LOGF_ERROR(
"Error in Sky commander number format (%s).", coords);
85 char RAStr[64], DecStr[64];
88 LOGF_DEBUG(
"Current RA: %s Current DEC: %s", RAStr, DecStr);
void SetTelescopeCapability(uint32_t cap, uint8_t slewRateCount)
SetTelescopeCapability sets the Telescope capabilities. All capabilities must be initialized.
void NewRaDec(double ra, double dec)
The child class calls this function when it has updates.
virtual const char * getDefaultName()
virtual bool Handshake()
perform handshake with device to check communication
virtual bool ReadScopeStatus()
Read telescope status.
int tty_write(int fd, const char *buf, int nbytes, int *nbytes_written)
Writes a buffer to fd.
int tty_read(int fd, char *buf, int nbytes, int timeout, int *nbytes_read)
read buffer from terminal
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[].
Implementations for common driver routines.
#define LOGF_DEBUG(fmt,...)
#define LOGF_ERROR(fmt,...)
#define SKYCOMMANDER_TIMEOUT
std::unique_ptr< SkyCommander > skycommander(new SkyCommander())