Instrument Neutral Distributed Interface INDI  1.9.5
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
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, u_int8_t *rate)
 
bool set_guide_rate (CELESTRON_AXIS axis, u_int8_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 199 of file celestrondriver.h.

Constructor & Destructor Documentation

◆ CelestronDriver()

CelestronDriver::CelestronDriver ( )
inline

Definition at line 202 of file celestrondriver.h.

◆ ~CelestronDriver()

virtual CelestronDriver::~CelestronDriver ( )
virtualdefault

Member Function Documentation

◆ abort()

bool CelestronDriver::abort ( )

Definition at line 641 of file celestrondriver.cpp.

◆ check_aligned()

bool CelestronDriver::check_aligned ( bool *  isAligned)

Definition at line 1039 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 1171 of file celestrondriver.cpp.

◆ foc_exists()

bool CelestronDriver::foc_exists ( )

Definition at line 1071 of file celestrondriver.cpp.

◆ foc_limits()

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

Definition at line 1147 of file celestrondriver.cpp.

◆ foc_move()

bool CelestronDriver::foc_move ( uint32_t  steps)

Definition at line 1128 of file celestrondriver.cpp.

◆ foc_moving()

bool CelestronDriver::foc_moving ( )

Definition at line 1138 of file celestrondriver.cpp.

◆ foc_position()

int CelestronDriver::foc_position ( )

Definition at line 1101 of file celestrondriver.cpp.

◆ get_azalt()

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

Definition at line 763 of file celestrondriver.cpp.

◆ get_dev_firmware()

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

Definition at line 479 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,
u_int8_t *  rate 
)

Definition at line 575 of file celestrondriver.cpp.

◆ get_location()

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

Definition at line 818 of file celestrondriver.cpp.

◆ get_model()

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

Definition at line 384 of file celestrondriver.cpp.

◆ get_pier_side()

bool CelestronDriver::get_pier_side ( char *  sop)

Definition at line 1027 of file celestrondriver.cpp.

◆ get_pulse_status()

bool CelestronDriver::get_pulse_status ( CELESTRON_DIRECTION  direction)

Definition at line 547 of file celestrondriver.cpp.

◆ get_radec()

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

Definition at line 734 of file celestrondriver.cpp.

◆ get_sim_dec()

double CelestronDriver::get_sim_dec ( )
inline

Definition at line 254 of file celestrondriver.h.

◆ get_sim_foc_offset()

int CelestronDriver::get_sim_foc_offset ( )
inline

Definition at line 258 of file celestrondriver.h.

◆ get_sim_ra()

double CelestronDriver::get_sim_ra ( )
inline

Definition at line 250 of file celestrondriver.h.

◆ get_track_mode()

bool CelestronDriver::get_track_mode ( CELESTRON_TRACK_MODE mode)

Definition at line 967 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 880 of file celestrondriver.cpp.

◆ get_variant()

bool CelestronDriver::get_variant ( char *  variant)

Definition at line 364 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 1241 of file celestrondriver.cpp.

◆ getPecValue()

int CelestronDriver::getPecValue ( size_t  index)

Definition at line 1344 of file celestrondriver.cpp.

◆ hibernate()

bool CelestronDriver::hibernate ( )

Definition at line 987 of file celestrondriver.cpp.

◆ indexreached()

bool CelestronDriver::indexreached ( bool *  atIndex)

Definition at line 1014 of file celestrondriver.cpp.

◆ is_slewing()

bool CelestronDriver::is_slewing ( bool *  slewing)

Definition at line 956 of file celestrondriver.cpp.

◆ isPecAtIndex()

bool CelestronDriver::isPecAtIndex ( bool  force = false)

Definition at line 1214 of file celestrondriver.cpp.

◆ isPecRecordDone()

bool CelestronDriver::isPecRecordDone ( )

Definition at line 1324 of file celestrondriver.cpp.

◆ lastalign()

bool CelestronDriver::lastalign ( )

Definition at line 1001 of file celestrondriver.cpp.

◆ model()

int CelestronDriver::model ( )

Definition at line 375 of file celestrondriver.cpp.

◆ move_sim_foc()

void CelestronDriver::move_sim_foc ( int  offset)
inline

Definition at line 262 of file celestrondriver.h.

◆ pecIndex()

size_t CelestronDriver::pecIndex ( )

Definition at line 1259 of file celestrondriver.cpp.

◆ PecPlayback()

bool CelestronDriver::PecPlayback ( bool  start)

Definition at line 1277 of file celestrondriver.cpp.

◆ PecRecord()

bool CelestronDriver::PecRecord ( bool  start)

Definition at line 1301 of file celestrondriver.cpp.

◆ PecSeekIndex()

bool CelestronDriver::PecSeekIndex ( )

Definition at line 1188 of file celestrondriver.cpp.

◆ PecStateStr() [1/2]

const char * CelestronDriver::PecStateStr ( )

Definition at line 1387 of file celestrondriver.cpp.

◆ PecStateStr() [2/2]

const char * CelestronDriver::PecStateStr ( PEC_STATE  state)

Definition at line 1392 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 512 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 846 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,
u_int8_t  rate 
)

Definition at line 601 of file celestrondriver.cpp.

◆ set_location()

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

Definition at line 789 of file celestrondriver.cpp.

◆ set_port_fd()

void CelestronDriver::set_port_fd ( int  port_fd)
inline

Definition at line 207 of file celestrondriver.h.

◆ set_sim_alt()

void CelestronDriver::set_sim_alt ( double  alt)
inline

Definition at line 246 of file celestrondriver.h.

◆ set_sim_az()

void CelestronDriver::set_sim_az ( double  az)
inline

Definition at line 242 of file celestrondriver.h.

◆ set_sim_dec()

void CelestronDriver::set_sim_dec ( double  dec)
inline

Definition at line 238 of file celestrondriver.h.

◆ set_sim_gps_status()

void CelestronDriver::set_sim_gps_status ( CELESTRON_GPS_STATUS  val)
inline

Definition at line 226 of file celestrondriver.h.

◆ set_sim_ra()

void CelestronDriver::set_sim_ra ( double  ra)
inline

Definition at line 234 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 218 of file celestrondriver.h.

◆ set_sim_slewing()

void CelestronDriver::set_sim_slewing ( bool  isSlewing)
inline

Definition at line 230 of file celestrondriver.h.

◆ set_sim_track_mode()

void CelestronDriver::set_sim_track_mode ( CELESTRON_TRACK_MODE  val)
inline

Definition at line 222 of file celestrondriver.h.

◆ set_simulation()

void CelestronDriver::set_simulation ( bool  enable)
inline

Definition at line 211 of file celestrondriver.h.

◆ set_track_mode()

bool CelestronDriver::set_track_mode ( CELESTRON_TRACK_MODE  mode)

Definition at line 978 of file celestrondriver.cpp.

◆ set_track_rate()

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

Definition at line 1050 of file celestrondriver.cpp.

◆ setPecValue()

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

Definition at line 1362 of file celestrondriver.cpp.

◆ slew_azalt()

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

Definition at line 667 of file celestrondriver.cpp.

◆ slew_radec()

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

Definition at line 647 of file celestrondriver.cpp.

◆ start_motion()

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

Definition at line 621 of file celestrondriver.cpp.

◆ startmovetoindex()

bool CelestronDriver::startmovetoindex ( )

Definition at line 1007 of file celestrondriver.cpp.

◆ stop_motion()

bool CelestronDriver::stop_motion ( CELESTRON_DIRECTION  dir)

Definition at line 632 of file celestrondriver.cpp.

◆ sync()

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

Definition at line 687 of file celestrondriver.cpp.

◆ unsync()

bool CelestronDriver::unsync ( )

Definition at line 709 of file celestrondriver.cpp.

◆ updatePecState()

PEC_STATE CelestronDriver::updatePecState ( )

Definition at line 1371 of file celestrondriver.cpp.

◆ wakeup()

bool CelestronDriver::wakeup ( )

Definition at line 994 of file celestrondriver.cpp.

Member Data Documentation

◆ fd

int CelestronDriver::fd = 0
protected

Definition at line 377 of file celestrondriver.h.

◆ pecState

PEC_STATE CelestronDriver::pecState { PEC_STATE::NotKnown }

Definition at line 337 of file celestrondriver.h.

◆ response

char CelestronDriver::response[MAX_RESP_SIZE]
protected

Definition at line 374 of file celestrondriver.h.

◆ sim_data

SimData CelestronDriver::sim_data
protected

Definition at line 376 of file celestrondriver.h.

◆ sim_dec_guide_rate

char CelestronDriver::sim_dec_guide_rate = 50
protected

Definition at line 380 of file celestrondriver.h.

◆ sim_ra_guide_rate

char CelestronDriver::sim_ra_guide_rate = 50
protected

Definition at line 379 of file celestrondriver.h.

◆ simIndex

int CelestronDriver::simIndex

Definition at line 359 of file celestrondriver.h.

◆ simRecordStart

int CelestronDriver::simRecordStart

Definition at line 360 of file celestrondriver.h.

◆ simSeekIndex

bool CelestronDriver::simSeekIndex = false

Definition at line 361 of file celestrondriver.h.

◆ simulation

bool CelestronDriver::simulation = false
protected

Definition at line 375 of file celestrondriver.h.


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