Instrument Neutral Distributed Interface INDI 2.2.5
CelestronDriver Class Reference

#include <celestrondriver.h>

Inheritance diagram for CelestronDriver:
MockCelestronDriver

Public Member Functions

 CelestronDriver ()
virtual ~CelestronDriver ()=default
const char * getDeviceName ()
void set_port_fd (int port_fd)
void set_simulation (bool enable)
void set_device (const char *name)
void set_sim_slew_rate (CELESTRON_SLEW_RATE val)
void set_sim_track_mode (CELESTRON_TRACK_MODE val)
void set_sim_gps_status (CELESTRON_GPS_STATUS val)
void set_sim_slewing (bool isSlewing)
void set_sim_ra (double ra)
void set_sim_dec (double dec)
void set_sim_az (double az)
void set_sim_alt (double alt)
double get_sim_ra ()
double get_sim_dec ()
int get_sim_foc_offset ()
void move_sim_foc (int offset)
bool echo ()
bool check_connection ()
bool get_firmware (FirmwareInfo *info)
bool get_version (char *version, size_t size)
bool get_variant (char *variant)
int model ()
bool get_model (char *model, size_t size, bool *isGem, bool *canPec, bool *hasHomeIndex)
bool get_dev_firmware (int dev, char *version, size_t size)
bool get_radec (double *ra, double *dec, bool precise)
bool get_azalt (double *az, double *alt, bool precise)
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)
bool stop_motion (CELESTRON_DIRECTION dir)
bool abort ()
bool slew_radec (double ra, double dec, bool precise)
bool slew_azalt (double az, double alt, bool precise)
bool sync (double ra, double dec, bool precise)
bool unsync ()
bool set_location (double longitude, double latitude)
bool get_location (double *longitude, double *latitude)
bool set_datetime (struct ln_date *utc, double utc_offset, bool dst=false, bool precise=false)
bool get_track_mode (CELESTRON_TRACK_MODE *mode)
bool set_track_mode (CELESTRON_TRACK_MODE mode)
bool is_slewing (bool *slewing)
bool hibernate ()
bool wakeup ()
bool lastalign ()
bool startmovetoindex ()
bool indexreached (bool *atIndex)
size_t send_pulse (CELESTRON_DIRECTION direction, unsigned char rate, unsigned char duration_msec)
bool get_pulse_status (CELESTRON_DIRECTION direction)
bool get_guide_rate (CELESTRON_AXIS axis, uint8_t *rate)
bool set_guide_rate (CELESTRON_AXIS axis, uint8_t rate)
bool get_pier_side (char *sop)
bool check_aligned (bool *isAligned)
bool set_track_rate (CELESTRON_TRACK_RATE rate, CELESTRON_TRACK_MODE mode)
bool foc_exists ()
int foc_position ()
bool foc_move (uint32_t steps)
bool foc_moving ()
bool foc_limits (int *low, int *high)
bool foc_abort ()
PEC_STATE updatePecState ()
bool PecSeekIndex ()
bool isPecAtIndex (bool force=false)
size_t pecIndex ()
int getPecValue (size_t index)
bool setPecValue (size_t index, int data)
bool PecPlayback (bool start)
bool PecRecord (bool start)
bool isPecRecordDone ()
size_t getPecNumBins ()
const char * PecStateStr (PEC_STATE)
const char * PecStateStr ()

Public Attributes

PEC_STATE pecState { PEC_STATE::NotKnown }
int simIndex
int simRecordStart
bool simSeekIndex = false

Protected Member Functions

void set_sim_response (const char *fmt,...)
virtual int serial_write (const char *cmd, int nbytes, int *nbytes_written)
virtual int serial_read (int nbytes, int *nbytes_read)
virtual int serial_read_section (char stop_char, int *nbytes_read)
size_t send_command (const char *cmd, size_t cmd_len, char *resp, size_t resp_len, bool ascii_cmd, bool ascii_resp)
size_t send_passthrough (int dest, int cmd_id, const char *payload, size_t payload_len, char *resp, size_t response_len)

Protected Attributes

char response [MAX_RESP_SIZE]
bool simulation = false
SimData sim_data
int fd = 0
char sim_ra_guide_rate = 50
char sim_dec_guide_rate = 50

Detailed Description

Definition at line 196 of file celestrondriver.h.

Constructor & Destructor Documentation

◆ CelestronDriver()

CelestronDriver::CelestronDriver ( )
inline

Definition at line 199 of file celestrondriver.h.

◆ ~CelestronDriver()

virtual CelestronDriver::~CelestronDriver ( )
virtualdefault

Member Function Documentation

◆ abort()

bool CelestronDriver::abort ( )

Definition at line 645 of file celestrondriver.cpp.

◆ check_aligned()

bool CelestronDriver::check_aligned ( bool * isAligned)

Definition at line 1043 of file celestrondriver.cpp.

◆ check_connection()

bool CelestronDriver::check_connection ( )

Definition at line 251 of file celestrondriver.cpp.

◆ echo()

bool CelestronDriver::echo ( )

Definition at line 340 of file celestrondriver.cpp.

◆ foc_abort()

bool CelestronDriver::foc_abort ( )

Definition at line 1175 of file celestrondriver.cpp.

◆ foc_exists()

bool CelestronDriver::foc_exists ( )

Definition at line 1075 of file celestrondriver.cpp.

◆ foc_limits()

bool CelestronDriver::foc_limits ( int * low,
int * high )

Definition at line 1151 of file celestrondriver.cpp.

◆ foc_move()

bool CelestronDriver::foc_move ( uint32_t steps)

Definition at line 1132 of file celestrondriver.cpp.

◆ foc_moving()

bool CelestronDriver::foc_moving ( )

Definition at line 1142 of file celestrondriver.cpp.

◆ foc_position()

int CelestronDriver::foc_position ( )

Definition at line 1105 of file celestrondriver.cpp.

◆ get_azalt()

bool CelestronDriver::get_azalt ( double * az,
double * alt,
bool precise )

Definition at line 767 of file celestrondriver.cpp.

◆ get_dev_firmware()

bool CelestronDriver::get_dev_firmware ( int dev,
char * version,
size_t size )

Definition at line 483 of file celestrondriver.cpp.

◆ get_firmware()

bool CelestronDriver::get_firmware ( FirmwareInfo * info)

Definition at line 266 of file celestrondriver.cpp.

◆ get_guide_rate()

bool CelestronDriver::get_guide_rate ( CELESTRON_AXIS axis,
uint8_t * rate )

Definition at line 579 of file celestrondriver.cpp.

◆ get_location()

bool CelestronDriver::get_location ( double * longitude,
double * latitude )

Definition at line 822 of file celestrondriver.cpp.

◆ get_model()

bool CelestronDriver::get_model ( char * model,
size_t size,
bool * isGem,
bool * canPec,
bool * hasHomeIndex )

Definition at line 388 of file celestrondriver.cpp.

◆ get_pier_side()

bool CelestronDriver::get_pier_side ( char * sop)

Definition at line 1031 of file celestrondriver.cpp.

◆ get_pulse_status()

bool CelestronDriver::get_pulse_status ( CELESTRON_DIRECTION direction)

Definition at line 551 of file celestrondriver.cpp.

◆ get_radec()

bool CelestronDriver::get_radec ( double * ra,
double * dec,
bool precise )

Definition at line 738 of file celestrondriver.cpp.

◆ get_sim_dec()

double CelestronDriver::get_sim_dec ( )
inline

Definition at line 251 of file celestrondriver.h.

◆ get_sim_foc_offset()

int CelestronDriver::get_sim_foc_offset ( )
inline

Definition at line 255 of file celestrondriver.h.

◆ get_sim_ra()

double CelestronDriver::get_sim_ra ( )
inline

Definition at line 247 of file celestrondriver.h.

◆ get_track_mode()

bool CelestronDriver::get_track_mode ( CELESTRON_TRACK_MODE * mode)

Definition at line 971 of file celestrondriver.cpp.

◆ get_utc_date_time()

bool CelestronDriver::get_utc_date_time ( double * utc_hours,
int * yy,
int * mm,
int * dd,
int * hh,
int * minute,
int * ss,
bool * dst,
bool precise )

Definition at line 884 of file celestrondriver.cpp.

◆ get_variant()

bool CelestronDriver::get_variant ( char * variant)

Definition at line 368 of file celestrondriver.cpp.

◆ get_version()

bool CelestronDriver::get_version ( char * version,
size_t size )

Definition at line 350 of file celestrondriver.cpp.

◆ getDeviceName()

const char * CelestronDriver::getDeviceName ( )

Definition at line 101 of file celestrondriver.cpp.

◆ getPecNumBins()

size_t CelestronDriver::getPecNumBins ( )

Definition at line 1245 of file celestrondriver.cpp.

◆ getPecValue()

int CelestronDriver::getPecValue ( size_t index)

Definition at line 1348 of file celestrondriver.cpp.

◆ hibernate()

bool CelestronDriver::hibernate ( )

Definition at line 991 of file celestrondriver.cpp.

◆ indexreached()

bool CelestronDriver::indexreached ( bool * atIndex)

Definition at line 1018 of file celestrondriver.cpp.

◆ is_slewing()

bool CelestronDriver::is_slewing ( bool * slewing)

Definition at line 960 of file celestrondriver.cpp.

◆ isPecAtIndex()

bool CelestronDriver::isPecAtIndex ( bool force = false)

Definition at line 1218 of file celestrondriver.cpp.

◆ isPecRecordDone()

bool CelestronDriver::isPecRecordDone ( )

Definition at line 1328 of file celestrondriver.cpp.

◆ lastalign()

bool CelestronDriver::lastalign ( )

Definition at line 1005 of file celestrondriver.cpp.

◆ model()

int CelestronDriver::model ( )

Definition at line 379 of file celestrondriver.cpp.

◆ move_sim_foc()

void CelestronDriver::move_sim_foc ( int offset)
inline

Definition at line 259 of file celestrondriver.h.

◆ pecIndex()

size_t CelestronDriver::pecIndex ( )

Definition at line 1263 of file celestrondriver.cpp.

◆ PecPlayback()

bool CelestronDriver::PecPlayback ( bool start)

Definition at line 1281 of file celestrondriver.cpp.

◆ PecRecord()

bool CelestronDriver::PecRecord ( bool start)

Definition at line 1305 of file celestrondriver.cpp.

◆ PecSeekIndex()

bool CelestronDriver::PecSeekIndex ( )

Definition at line 1192 of file celestrondriver.cpp.

◆ PecStateStr() [1/2]

const char * CelestronDriver::PecStateStr ( )

Definition at line 1391 of file celestrondriver.cpp.

◆ PecStateStr() [2/2]

const char * CelestronDriver::PecStateStr ( PEC_STATE state)

Definition at line 1396 of file celestrondriver.cpp.

◆ send_command()

size_t CelestronDriver::send_command ( const char * cmd,
size_t cmd_len,
char * resp,
size_t resp_len,
bool ascii_cmd,
bool ascii_resp )
protected

Definition at line 147 of file celestrondriver.cpp.

◆ send_passthrough()

size_t CelestronDriver::send_passthrough ( int dest,
int cmd_id,
const char * payload,
size_t payload_len,
char * resp,
size_t response_len )
protected

Definition at line 234 of file celestrondriver.cpp.

◆ send_pulse()

size_t CelestronDriver::send_pulse ( CELESTRON_DIRECTION direction,
unsigned char rate,
unsigned char duration_msec )

Definition at line 516 of file celestrondriver.cpp.

◆ serial_read()

int CelestronDriver::serial_read ( int nbytes,
int * nbytes_read )
protectedvirtual

Definition at line 119 of file celestrondriver.cpp.

◆ serial_read_section()

int CelestronDriver::serial_read_section ( char stop_char,
int * nbytes_read )
protectedvirtual

Reimplemented in MockCelestronDriver.

Definition at line 125 of file celestrondriver.cpp.

◆ serial_write()

int CelestronDriver::serial_write ( const char * cmd,
int nbytes,
int * nbytes_written )
protectedvirtual

Definition at line 112 of file celestrondriver.cpp.

◆ set_datetime()

bool CelestronDriver::set_datetime ( struct ln_date * utc,
double utc_offset,
bool dst = false,
bool precise = false )

Definition at line 850 of file celestrondriver.cpp.

◆ set_device()

void CelestronDriver::set_device ( const char * name)

Definition at line 106 of file celestrondriver.cpp.

◆ set_guide_rate()

bool CelestronDriver::set_guide_rate ( CELESTRON_AXIS axis,
uint8_t rate )

Definition at line 605 of file celestrondriver.cpp.

◆ set_location()

bool CelestronDriver::set_location ( double longitude,
double latitude )

Definition at line 793 of file celestrondriver.cpp.

◆ set_port_fd()

void CelestronDriver::set_port_fd ( int port_fd)
inline

Definition at line 204 of file celestrondriver.h.

◆ set_sim_alt()

void CelestronDriver::set_sim_alt ( double alt)
inline

Definition at line 243 of file celestrondriver.h.

◆ set_sim_az()

void CelestronDriver::set_sim_az ( double az)
inline

Definition at line 239 of file celestrondriver.h.

◆ set_sim_dec()

void CelestronDriver::set_sim_dec ( double dec)
inline

Definition at line 235 of file celestrondriver.h.

◆ set_sim_gps_status()

void CelestronDriver::set_sim_gps_status ( CELESTRON_GPS_STATUS val)
inline

Definition at line 223 of file celestrondriver.h.

◆ set_sim_ra()

void CelestronDriver::set_sim_ra ( double ra)
inline

Definition at line 231 of file celestrondriver.h.

◆ set_sim_response()

void CelestronDriver::set_sim_response ( const char * fmt,
... )
protected

◆ set_sim_slew_rate()

void CelestronDriver::set_sim_slew_rate ( CELESTRON_SLEW_RATE val)
inline

Definition at line 215 of file celestrondriver.h.

◆ set_sim_slewing()

void CelestronDriver::set_sim_slewing ( bool isSlewing)
inline

Definition at line 227 of file celestrondriver.h.

◆ set_sim_track_mode()

void CelestronDriver::set_sim_track_mode ( CELESTRON_TRACK_MODE val)
inline

Definition at line 219 of file celestrondriver.h.

◆ set_simulation()

void CelestronDriver::set_simulation ( bool enable)
inline

Definition at line 208 of file celestrondriver.h.

◆ set_track_mode()

bool CelestronDriver::set_track_mode ( CELESTRON_TRACK_MODE mode)

Definition at line 982 of file celestrondriver.cpp.

◆ set_track_rate()

bool CelestronDriver::set_track_rate ( CELESTRON_TRACK_RATE rate,
CELESTRON_TRACK_MODE mode )

Definition at line 1054 of file celestrondriver.cpp.

◆ setPecValue()

bool CelestronDriver::setPecValue ( size_t index,
int data )

Definition at line 1366 of file celestrondriver.cpp.

◆ slew_azalt()

bool CelestronDriver::slew_azalt ( double az,
double alt,
bool precise )

Definition at line 671 of file celestrondriver.cpp.

◆ slew_radec()

bool CelestronDriver::slew_radec ( double ra,
double dec,
bool precise )

Definition at line 651 of file celestrondriver.cpp.

◆ start_motion()

bool CelestronDriver::start_motion ( CELESTRON_DIRECTION dir,
CELESTRON_SLEW_RATE rate )

Definition at line 625 of file celestrondriver.cpp.

◆ startmovetoindex()

bool CelestronDriver::startmovetoindex ( )

Definition at line 1011 of file celestrondriver.cpp.

◆ stop_motion()

bool CelestronDriver::stop_motion ( CELESTRON_DIRECTION dir)

Definition at line 636 of file celestrondriver.cpp.

◆ sync()

bool CelestronDriver::sync ( double ra,
double dec,
bool precise )

Definition at line 691 of file celestrondriver.cpp.

◆ unsync()

bool CelestronDriver::unsync ( )

Definition at line 713 of file celestrondriver.cpp.

◆ updatePecState()

PEC_STATE CelestronDriver::updatePecState ( )

Definition at line 1375 of file celestrondriver.cpp.

◆ wakeup()

bool CelestronDriver::wakeup ( )

Definition at line 998 of file celestrondriver.cpp.

Member Data Documentation

◆ fd

int CelestronDriver::fd = 0
protected

Definition at line 374 of file celestrondriver.h.

◆ pecState

PEC_STATE CelestronDriver::pecState { PEC_STATE::NotKnown }

Definition at line 334 of file celestrondriver.h.

◆ response

char CelestronDriver::response[MAX_RESP_SIZE]
protected

Definition at line 371 of file celestrondriver.h.

◆ sim_data

SimData CelestronDriver::sim_data
protected

Definition at line 373 of file celestrondriver.h.

◆ sim_dec_guide_rate

char CelestronDriver::sim_dec_guide_rate = 50
protected

Definition at line 377 of file celestrondriver.h.

◆ sim_ra_guide_rate

char CelestronDriver::sim_ra_guide_rate = 50
protected

Definition at line 376 of file celestrondriver.h.

◆ simIndex

int CelestronDriver::simIndex

Definition at line 356 of file celestrondriver.h.

◆ simRecordStart

int CelestronDriver::simRecordStart

Definition at line 357 of file celestrondriver.h.

◆ simSeekIndex

bool CelestronDriver::simSeekIndex = false

Definition at line 358 of file celestrondriver.h.

◆ simulation

bool CelestronDriver::simulation = false
protected

Definition at line 372 of file celestrondriver.h.


The documentation for this class was generated from the following files: