Instrument Neutral Distributed Interface INDI  2.0.2
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
iEQ::Base Class Reference

The BaseFirmware class provides control for iOptron version 2014 v2.0 protocol. More...

#include <ieqdriverbase.h>

Inheritance diagram for iEQ::Base:
iEQ::Simulator

Classes

struct  FirmwareInfo
 
struct  Info
 
struct  MountInfo
 

Public Member Functions

 Base ()
 
virtual ~Base ()=default
 
void setDebugEnabled (bool enable)
 
void setDeviceName (const std::string &name)
 
const char * getDeviceName ()
 
bool getStatus (Info *info)
 
bool getModel ()
 
bool getMainFirmware ()
 
bool getRADEFirmware ()
 
bool getCoords (double *ra, double *dec)
 
bool getUTCDateTime (double *utc_hours, int *yy, int *mm, int *dd, int *hh, int *minute, int *ss)
 
const FirmwareInfogetFirmwareInfo () const
 
bool getPierSide (IEQ_PIER_SIDE *pierSide)
 
bool initCommunication (int fd)
 initCommunication Checks if communication with the mount is working More...
 
bool sendCommand (const char *cmd, char *res=nullptr, int cmd_len=-1, int res_len=-1)
 sendCommand Send a string command to device. More...
 
void hexDump (char *buf, const char *data, int size)
 hexDump Helper function to print non-string commands to the logger so it is easier to debug More...
 
bool isCommandSupported (const std::string &command, bool silent=false)
 isCommandSupported Check if specific iOptron command is supported for this mount model More...
 
virtual bool startMotion (Direction dir)
 
virtual bool stopMotion (Direction dir)
 
virtual bool setSlewRate (SlewRate rate)
 
virtual bool setCustomRATrackRate (double rate)
 
virtual bool setTrackMode (TrackRate rate)
 
virtual bool setTrackEnabled (bool enabled)
 
virtual bool abort ()
 
virtual bool slew ()
 
virtual bool sync ()
 
virtual bool setRA (double ra)
 
virtual bool setDE (double dec)
 
virtual bool setAz (double az)
 
virtual bool setAlt (double alt)
 
virtual bool findHome ()
 
virtual bool gotoHome ()
 
virtual bool setCurrentHome ()
 
virtual bool park ()
 
virtual bool unpark ()
 
virtual bool setParkAz (double az)
 
virtual bool setParkAlt (double alt)
 
virtual bool setGuideRate (double raRate, double deRate)
 
virtual bool getGuideRate (double *raRate, double *deRate)
 
virtual bool startGuide (Direction dir, uint32_t ms)
 
virtual bool setLongitude (double longitude)
 
virtual bool setLatitude (double latitude)
 
virtual bool setLocalDate (int yy, int mm, int dd)
 
virtual bool setLocalTime (int hh, int mm, int ss)
 
virtual bool setUTCOffset (double offset_hours)
 
virtual bool setDST (bool enabled)
 

Protected Member Functions

double DecodeString (const char *data, size_t size, double factor)
 DecodeString converts the string to a double by dividing by the factor. More...
 
int DecodeString (const char *data, size_t size)
 DecodeString converts a string of defined size to an int. More...
 

Protected Attributes

int m_PortFD {-1}
 
std::string m_DeviceName { "iEQ" }
 
bool m_IsDebug { false }
 
FirmwareInfo m_FirmwareInfo
 
const std::vector< MountInfom_MountList
 

Static Protected Attributes

static const uint8_t DRIVER_TIMEOUT { 3 }
 
static const uint8_t DRIVER_LEN { 64 }
 
static const char DRIVER_STOP_CHAR { '#' }
 
constexpr static const double ieqDegrees { 60.0 * 60.0 * 100.0 }
 
constexpr static const double ieqHours { 60.0 * 60.0 * 1000.0 }
 

Detailed Description

The BaseFirmware class provides control for iOptron version 2014 v2.0 protocol.

Definition at line 57 of file ieqdriverbase.h.

Constructor & Destructor Documentation

◆ Base()

iEQ::Base::Base ( )

Definition at line 38 of file ieqdriverbase.cpp.

◆ ~Base()

virtual iEQ::Base::~Base ( )
virtualdefault

Member Function Documentation

◆ abort()

bool iEQ::Base::abort ( )
virtual

Definition at line 350 of file ieqdriverbase.cpp.

◆ DecodeString() [1/2]

int iEQ::Base::DecodeString ( const char *  data,
size_t  size 
)
protected

DecodeString converts a string of defined size to an int.

Parameters
data
size
Returns

Definition at line 825 of file ieqdriverbase.cpp.

◆ DecodeString() [2/2]

double iEQ::Base::DecodeString ( const char *  data,
size_t  size,
double  factor 
)
protected

DecodeString converts the string to a double by dividing by the factor.

Parameters
data
size
factor
Returns

Definition at line 820 of file ieqdriverbase.cpp.

◆ findHome()

bool iEQ::Base::findHome ( )
virtual

Definition at line 188 of file ieqdriverbase.cpp.

◆ getCoords()

bool iEQ::Base::getCoords ( double *  ra,
double *  dec 
)

Get RA/DEC

Definition at line 525 of file ieqdriverbase.cpp.

◆ getDeviceName()

const char* iEQ::Base::getDeviceName ( )
inline

Definition at line 101 of file ieqdriverbase.h.

◆ getFirmwareInfo()

const FirmwareInfo& iEQ::Base::getFirmwareInfo ( ) const
inline

Get firmware information

Definition at line 122 of file ieqdriverbase.h.

◆ getGuideRate()

bool iEQ::Base::getGuideRate ( double *  raRate,
double *  deRate 
)
virtual

Definition at line 279 of file ieqdriverbase.cpp.

◆ getMainFirmware()

bool iEQ::Base::getMainFirmware ( )

Get mainboard and controller firmware only

Definition at line 98 of file ieqdriverbase.cpp.

◆ getModel()

bool iEQ::Base::getModel ( )

Initilizes communication with the mount and gets mount model

Definition at line 72 of file ieqdriverbase.cpp.

◆ getPierSide()

bool iEQ::Base::getPierSide ( IEQ_PIER_SIDE pierSide)

Definition at line 625 of file ieqdriverbase.cpp.

◆ getRADEFirmware()

bool iEQ::Base::getRADEFirmware ( )

Get RA and DEC firmware info

Definition at line 118 of file ieqdriverbase.cpp.

◆ getStatus()

bool iEQ::Base::getStatus ( Info info)

Get iEQ current status info

Definition at line 580 of file ieqdriverbase.cpp.

◆ getUTCDateTime()

bool iEQ::Base::getUTCDateTime ( double *  utc_hours,
int *  yy,
int *  mm,
int *  dd,
int *  hh,
int *  minute,
int *  ss 
)

Get UTC/Date/Time

Definition at line 539 of file ieqdriverbase.cpp.

◆ gotoHome()

bool iEQ::Base::gotoHome ( )
virtual

Definition at line 198 of file ieqdriverbase.cpp.

◆ hexDump()

void iEQ::Base::hexDump ( char *  buf,
const char *  data,
int  size 
)

hexDump Helper function to print non-string commands to the logger so it is easier to debug

Parameters
bufbuffer to format the command into hex strings.
datathe command
sizelength of the command in bytes.
Note
This is called internally by sendCommand, no need to call it directly.

Definition at line 762 of file ieqdriverbase.cpp.

◆ initCommunication()

bool iEQ::Base::initCommunication ( int  fd)

initCommunication Checks if communication with the mount is working

Parameters
fdfile descriptor
deviceNamename of device used to log debugging messages.
Returns
True if communication is successful, false otherwise.

Definition at line 42 of file ieqdriverbase.cpp.

◆ isCommandSupported()

bool iEQ::Base::isCommandSupported ( const std::string &  command,
bool  silent = false 
)

isCommandSupported Check if specific iOptron command is supported for this mount model

Parameters
commandcommand code (e.g. MS)
silentif false (default), it will report why command is not supported. If true, it will not print any messages.
Returns
True if supported, false otherwise

Definition at line 771 of file ieqdriverbase.cpp.

◆ park()

bool iEQ::Base::park ( )
virtual

Definition at line 326 of file ieqdriverbase.cpp.

◆ sendCommand()

bool iEQ::Base::sendCommand ( const char *  cmd,
char *  res = nullptr,
int  cmd_len = -1,
int  res_len = -1 
)

sendCommand Send a string command to device.

Parameters
cmdCommand to be sent. Can be either NULL TERMINATED or just byte buffer.
resIf not nullptr, the function will wait for a response from the device. If nullptr, it returns true immediately after the command is successfully sent.
cmd_lenif -1, it is assumed that the cmd is a null-terminated string. Otherwise, it would write cmd_len bytes from the cmd buffer.
res_lenif -1 and if res is not nullptr, the function will read until it detects the default delimeter DRIVER_STOP_CHAR up to DRIVER_LEN length. Otherwise, the function will read res_len from the device and store it in res.
Returns
True if successful, false otherwise.

Definition at line 703 of file ieqdriverbase.cpp.

◆ setAlt()

bool iEQ::Base::setAlt ( double  alt)
virtual

Definition at line 419 of file ieqdriverbase.cpp.

◆ setAz()

bool iEQ::Base::setAz ( double  az)
virtual

Definition at line 406 of file ieqdriverbase.cpp.

◆ setCurrentHome()

bool iEQ::Base::setCurrentHome ( )
virtual

Definition at line 204 of file ieqdriverbase.cpp.

◆ setCustomRATrackRate()

bool iEQ::Base::setCustomRATrackRate ( double  rate)
virtual

Definition at line 245 of file ieqdriverbase.cpp.

◆ setDE()

bool iEQ::Base::setDE ( double  dec)
virtual

Definition at line 393 of file ieqdriverbase.cpp.

◆ setDebugEnabled()

void iEQ::Base::setDebugEnabled ( bool  enable)
inline

Definition at line 93 of file ieqdriverbase.h.

◆ setDeviceName()

void iEQ::Base::setDeviceName ( const std::string &  name)
inline

Definition at line 97 of file ieqdriverbase.h.

◆ setDST()

bool iEQ::Base::setDST ( bool  enabled)
virtual

Definition at line 508 of file ieqdriverbase.cpp.

◆ setGuideRate()

bool iEQ::Base::setGuideRate ( double  raRate,
double  deRate 
)
virtual

Definition at line 262 of file ieqdriverbase.cpp.

◆ setLatitude()

bool iEQ::Base::setLatitude ( double  latitude)
virtual

Definition at line 477 of file ieqdriverbase.cpp.

◆ setLocalDate()

bool iEQ::Base::setLocalDate ( int  yy,
int  mm,
int  dd 
)
virtual

Definition at line 488 of file ieqdriverbase.cpp.

◆ setLocalTime()

bool iEQ::Base::setLocalTime ( int  hh,
int  mm,
int  ss 
)
virtual

Definition at line 498 of file ieqdriverbase.cpp.

◆ setLongitude()

bool iEQ::Base::setLongitude ( double  longitude)
virtual

Definition at line 466 of file ieqdriverbase.cpp.

◆ setParkAlt()

bool iEQ::Base::setParkAlt ( double  alt)
virtual

Definition at line 448 of file ieqdriverbase.cpp.

◆ setParkAz()

bool iEQ::Base::setParkAz ( double  az)
virtual

Definition at line 432 of file ieqdriverbase.cpp.

◆ setRA()

bool iEQ::Base::setRA ( double  ra)
virtual

Definition at line 380 of file ieqdriverbase.cpp.

◆ setSlewRate()

bool iEQ::Base::setSlewRate ( SlewRate  rate)
virtual

Definition at line 210 of file ieqdriverbase.cpp.

◆ setTrackEnabled()

bool iEQ::Base::setTrackEnabled ( bool  enabled)
virtual

Definition at line 374 of file ieqdriverbase.cpp.

◆ setTrackMode()

bool iEQ::Base::setTrackMode ( TrackRate  rate)
virtual

Definition at line 218 of file ieqdriverbase.cpp.

◆ setUTCOffset()

bool iEQ::Base::setUTCOffset ( double  offset_hours)
virtual

Definition at line 514 of file ieqdriverbase.cpp.

◆ slew()

bool iEQ::Base::slew ( )
virtual

Definition at line 356 of file ieqdriverbase.cpp.

◆ startGuide()

bool iEQ::Base::startGuide ( Direction  dir,
uint32_t  ms 
)
virtual

Definition at line 297 of file ieqdriverbase.cpp.

◆ startMotion()

bool iEQ::Base::startMotion ( Direction  dir)
virtual

Definition at line 138 of file ieqdriverbase.cpp.

◆ stopMotion()

bool iEQ::Base::stopMotion ( Direction  dir)
virtual

Definition at line 167 of file ieqdriverbase.cpp.

◆ sync()

bool iEQ::Base::sync ( )
virtual

Definition at line 368 of file ieqdriverbase.cpp.

◆ unpark()

bool iEQ::Base::unpark ( )
virtual

Definition at line 341 of file ieqdriverbase.cpp.

Member Data Documentation

◆ DRIVER_LEN

const uint8_t iEQ::Base::DRIVER_LEN { 64 }
staticprotected

Definition at line 234 of file ieqdriverbase.h.

◆ DRIVER_STOP_CHAR

const char iEQ::Base::DRIVER_STOP_CHAR { '#' }
staticprotected

Definition at line 235 of file ieqdriverbase.h.

◆ DRIVER_TIMEOUT

const uint8_t iEQ::Base::DRIVER_TIMEOUT { 3 }
staticprotected

Definition at line 233 of file ieqdriverbase.h.

◆ ieqDegrees

constexpr static const double iEQ::Base::ieqDegrees { 60.0 * 60.0 * 100.0 }
staticconstexprprotected

Definition at line 275 of file ieqdriverbase.h.

◆ ieqHours

constexpr static const double iEQ::Base::ieqHours { 60.0 * 60.0 * 1000.0 }
staticconstexprprotected

Definition at line 276 of file ieqdriverbase.h.

◆ m_DeviceName

std::string iEQ::Base::m_DeviceName { "iEQ" }
protected

Definition at line 231 of file ieqdriverbase.h.

◆ m_FirmwareInfo

FirmwareInfo iEQ::Base::m_FirmwareInfo
protected

Definition at line 237 of file ieqdriverbase.h.

◆ m_IsDebug

bool iEQ::Base::m_IsDebug { false }
protected

Definition at line 232 of file ieqdriverbase.h.

◆ m_MountList

const std::vector<MountInfo> iEQ::Base::m_MountList
protected
Initial value:
=
{
{"0010", "Cube II EQ", "160610"},
{"0011", "Smart EQ Pro+", "161028"},
{"0025", "CEM25", "170106"},
{"0026", "CEM25-EC", "170518"},
{"0030", "iEQ30 Pro", "161101"},
{"0040", "CEM40", "181018"},
{"0041", "CEM40-EC", "181018"},
{"0043", "GEM45", "191018"},
{"0044", "GEM45-EC", "191018"},
{"0045", "iEQ45 Pro EQ", "161101"},
{"0046", "iEQ45 Pro AA", "161101"},
{"0060", "CEM60", "161101"},
{"0061", "CEM60-EC", "161101"},
{"5010", "Cube II AA", "160610"},
{"5035", "AZ Mount Pro", "170410"},
}

Definition at line 239 of file ieqdriverbase.h.

◆ m_PortFD

int iEQ::Base::m_PortFD {-1}
protected

Definition at line 230 of file ieqdriverbase.h.


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