38 #define ISNEXSTAR 0x11
39 #define ISSTARSENSE 0x13
40 #define MINSTSENSVER 1.18
41 #define MAX_RESP_SIZE 20
44 #define CELESTRON_DEV_RA 0x10
45 #define CELESTRON_DEV_DEC 0x11
46 #define CELESTRON_DEV_GPS 0xb0
48 #define CELESTRON_DEV_FOC 0x12
51 #define MC_GET_POSITION 0x01
52 #define MC_GOTO_FAST 0x02
53 #define MC_SET_POS_GUIDERATE 0x06
54 #define MC_SET_NEG_GUIDERATE 0x07
55 #define MC_LEVEL_START 0x0b
56 #define MC_PEC_RECORD_START 0x0C
57 #define MC_PEC_PLAYBACK 0x0D
59 #define MTR_PECBIN 0x0E
61 #define MC_LEVEL_DONE 0x12
62 #define MC_SLEW_DONE 0x13
63 #define MC_PEC_RECORD_DONE 0x15
64 #define MC_PEC_RECORD_STOP 0x16
66 #define MC_GOTO_SLOW 0x17
68 #define MC_AT_INDEX 0x18
69 #define MC_SEEK_INDEX 0x19
70 #define MC_MOVE_POS 0x24
71 #define MC_MOVE_NEG 0x25
73 #define MTR_AUX_GUIDE 0x26
74 #define MTR_IS_AUX_GUIDE_ACTIVE 0x27
77 #define MC_PEC_READ_DATA 0x30
80 #define MC_PEC_WRITE_DATA 0x31
83 #define MC_SET_AUTOGUIDE_RATE 0x46
84 #define MC_GET_AUTOGUIDE_RATE 0x47
87 #define FOC_CALIB_ENABLE 42
88 #define FOC_CALIB_DONE 43
89 #define FOC_GET_HS_POSITIONS 44
190 uint16_t
dd2nex(
double angle);
191 uint32_t
dd2pnex(
double angle);
192 double nex2dd(uint32_t value);
193 double pnex2dd(uint32_t value);
272 bool get_model(
char *
model,
size_t size,
bool *isGem,
bool *canPec,
bool *hasHomeIndex);
275 bool get_azalt(
double *az,
double *alt,
bool precise);
276 bool get_utc_date_time(
double *utc_hours,
int *yy,
int *mm,
int *dd,
int *hh,
int *minute,
int *ss,
bool *dst,
284 bool slew_azalt(
double az,
double alt,
bool precise);
285 bool sync(
double ra,
double dec,
bool precise);
291 bool set_datetime(
struct ln_date *utc,
double utc_offset,
bool dst =
false,
bool precise =
false);
362 virtual int serial_write(
const char *
cmd,
int nbytes,
int *nbytes_written);
363 virtual int serial_read(
int nbytes,
int *nbytes_read);
366 size_t send_command(
const char *
cmd,
size_t cmd_len,
char *resp,
size_t resp_len,
367 bool ascii_cmd,
bool ascii_resp);
369 size_t payload_len,
char *resp,
size_t response_len);
386 bool Save(
const char * filename);
395 bool Load(
const char * fileName);
408 double wormArcSeconds = 7200;
409 double rateScale = 1024;
411 const double SIDEREAL_ARCSEC_PER_SEC = 360.0 * 60.0 * 60.0 / (23.0 * 3600.0 + 56 * 60 + 4.09);
415 void Kalman(
PecData newData,
int num);
@ PEC_SEEKING
The PEC index is being searched for, goes to PEC_INDEXED when found
@ PEC_AVAILABLE
PEC is available but inactive, can seek index Seek index is only available command
@ PEC_PLAYBACK
PEC is being played back, stays in this state until stopped equivalent to TelescopePECState PEC_ON
@ PEC_RECORDING
PEC is being recorded, goes to PEC_INDEXED when completed
@ PEC_NOT_AVAILABLE
PEC is not available, hardware has been checked, no other state is possible
@ PEC_INDEXED
the PEC index has been found, can go to Playback or Recording this is equivalent to TelescopePECState...
bool slew_radec(double ra, double dec, bool precise)
bool get_azalt(double *az, double *alt, bool precise)
bool set_guide_rate(CELESTRON_AXIS axis, uint8_t rate)
void set_port_fd(int port_fd)
bool indexreached(bool *atIndex)
bool check_aligned(bool *isAligned)
void set_sim_alt(double alt)
bool set_datetime(struct ln_date *utc, double utc_offset, bool dst=false, bool precise=false)
bool set_location(double longitude, double latitude)
bool stop_motion(CELESTRON_DIRECTION dir)
int getPecValue(size_t index)
void set_sim_track_mode(CELESTRON_TRACK_MODE val)
bool get_firmware(FirmwareInfo *info)
bool sync(double ra, double dec, bool precise)
bool foc_limits(int *low, int *high)
bool PecPlayback(bool start)
bool get_dev_firmware(int dev, char *version, size_t size)
size_t send_pulse(CELESTRON_DIRECTION direction, unsigned char rate, unsigned char duration_msec)
size_t send_passthrough(int dest, int cmd_id, const char *payload, size_t payload_len, char *resp, size_t response_len)
bool get_radec(double *ra, double *dec, bool precise)
bool get_track_mode(CELESTRON_TRACK_MODE *mode)
void move_sim_foc(int offset)
void set_device(const char *name)
void set_simulation(bool enable)
bool set_track_rate(CELESTRON_TRACK_RATE rate, CELESTRON_TRACK_MODE mode)
bool set_track_mode(CELESTRON_TRACK_MODE mode)
void set_sim_az(double az)
bool get_model(char *model, size_t size, bool *isGem, bool *canPec, bool *hasHomeIndex)
bool get_version(char *version, size_t size)
size_t send_command(const char *cmd, size_t cmd_len, char *resp, size_t resp_len, bool ascii_cmd, bool ascii_resp)
char response[MAX_RESP_SIZE]
virtual int serial_read(int nbytes, int *nbytes_read)
const char * PecStateStr()
void set_sim_gps_status(CELESTRON_GPS_STATUS val)
void set_sim_response(const char *fmt,...)
virtual ~CelestronDriver()=default
bool PecRecord(bool start)
bool isPecAtIndex(bool force=false)
bool get_variant(char *variant)
bool get_location(double *longitude, double *latitude)
void set_sim_ra(double ra)
const char * getDeviceName()
bool get_pulse_status(CELESTRON_DIRECTION direction)
void set_sim_slewing(bool isSlewing)
virtual int serial_write(const char *cmd, int nbytes, int *nbytes_written)
PEC_STATE updatePecState()
virtual int serial_read_section(char stop_char, int *nbytes_read)
bool get_guide_rate(CELESTRON_AXIS axis, uint8_t *rate)
void set_sim_dec(double dec)
bool slew_azalt(double az, double alt, bool precise)
void set_sim_slew_rate(CELESTRON_SLEW_RATE val)
bool setPecValue(size_t index, int data)
bool foc_move(uint32_t steps)
bool get_pier_side(char *sop)
bool is_slewing(bool *slewing)
bool get_utc_date_time(double *utc_hours, int *yy, int *mm, int *dd, int *hh, int *minute, int *ss, bool *dst, bool precise)
bool start_motion(CELESTRON_DIRECTION dir, CELESTRON_SLEW_RATE rate)
const char * getDeviceName()
bool Load(CelestronDriver *driver)
bool Save(const char *filename)
Implementations for common driver routines.
double pnex2dd(uint32_t value)
uint32_t dd2pnex(double angle)
uint16_t dd2nex(double angle)
double trimDecAngle(double angle)
double nex2dd(uint32_t value)
struct FirmwareInfo FirmwareInfo
CELESTRON_TRACK_MODE celestronTrackMode
CELESTRON_SLEW_RATE slewRate
CELESTRON_GPS_STATUS gpsStatus
CELESTRON_TRACK_MODE trackMode