Instrument Neutral Distributed Interface INDI  1.7.6
Macros | Enumerations | Functions | Variables
indicom.h File Reference

Implementations for common driver routines. More...

Go to the source code of this file.


#define J2000   2451545.0
#define ERRMSG_SIZE   1024
#define STELLAR_DAY   86164.098903691
#define TRACKRATE_SIDEREAL   ((360.0 * 3600.0) / STELLAR_DAY)
#define SOLAR_DAY   86400
#define TRACKRATE_SOLAR   ((360.0 * 3600.0) / SOLAR_DAY)
#define TRACKRATE_LUNAR   14.511415
#define EARTHRADIUSPOLAR   6356752.0
#define EARTHRADIUSMEAN   6372797.0
#define EULER   2.71828182845904523536028747135266249775724709369995
#define ROOT2   1.41421356237309504880168872420969807856967187537694
#define AIRY   1.21966
#define CIRCLE_DEG   360
#define CIRCLE_AM   (CIRCLE_DEG * 60)
#define CIRCLE_AS   (CIRCLE_AM * 60)
#define RAD_AS   (CIRCLE_AS/(M_PI*2))
#define ASTRONOMICALUNIT   1.495978707E+11
#define PARSEC   (ASTRONOMICALUNIT*2.06264806247096E+5)
#define LIGHTSPEED   299792458.0
#define LY   (LIGHTSPEED * SOLAR_DAY * 365)


enum  TTY_ERROR {


int tty_read (int fd, char *buf, int nbytes, int timeout, int *nbytes_read)
 read buffer from terminal More...
int tty_read_section (int fd, char *buf, char stop_char, int timeout, int *nbytes_read)
 read buffer from terminal with a delimiter More...
int tty_nread_section (int fd, char *buf, int nsize, char stop_char, int timeout, int *nbytes_read)
 read buffer from terminal with a delimiter More...
int tty_write (int fd, const char *buffer, int nbytes, int *nbytes_written)
 Writes a buffer to fd. More...
int tty_write_string (int fd, const char *buffer, int *nbytes_written)
 Writes a null terminated string to fd. More...
int tty_connect (const char *device, int bit_rate, int word_size, int parity, int stop_bits, int *fd)
 Establishes a tty connection to a terminal device. More...
int tty_disconnect (int fd)
 Closes a tty connection and flushes the bus. More...
void tty_error_msg (int err_code, char *err_msg, int err_msg_len)
 Retrieve the tty error message. More...
void tty_set_debug (int debug)
 tty_set_debug Enable or disable debug which prints verbose information. More...
void tty_set_gemini_udp_format (int enabled)
void tty_set_skywatcher_udp_format (int enabled)
void tty_clr_trailing_read_lf (int enabled)
int tty_timeout (int fd, int timeout)
int fs_sexa (char *out, double a, int w, int fracbase)
 Converts a sexagesimal number to a string. More...
int f_scansexa (const char *str0, double *dp)
 convert sexagesimal string str AxBxC to double. More...
int extractISOTime (const char *timestr, struct ln_date *iso_date)
 Extract ISO 8601 time and store it in a tm struct. More...
void getSexComponents (double value, int *d, int *m, int *s)
void getSexComponentsIID (double value, int *d, int *m, double *s)
int numberFormat (char *buf, const char *format, double value)
 Fill buffer with properly formatted INumber string. More...
const char * timestamp ()
 Create an ISO 8601 formatted time stamp. The format is YYYY-MM-DDTHH:MM:SS. More...
double rangeHA (double r)
 rangeHA Limits the hour angle value to be between -12 —> 12 More...
double range24 (double r)
 range24 Limits a number to be between 0-24 range. More...
double range360 (double r)
 range360 Limits an angle to be between 0-360 degrees. More...
double rangeDec (double r)
 rangeDec Limits declination value to be in -90 to 90 range. More...
double get_local_sidereal_time (double longitude)
 get_local_sidereal_time Returns local sideral time given longitude and system clock. More...
double get_local_hour_angle (double local_sideral_time, double ra)
 get_local_hour_angle Returns local hour angle of an object More...
void get_alt_az_coordinates (double hour_angle, double dec, double latitude, double *alt, double *az)
 get_alt_az_coordinates Returns alt-azimuth coordinates of an object More...
double estimate_geocentric_elevation (double latitude, double sea_level_elevation)
 estimate_geocentric_elevation Returns an estimation of the actual geocentric elevation More...
double estimate_field_rotation_rate (double Alt, double Az, double latitude)
 estimate_field_rotation_rate Returns an estimation of the field rotation rate of the object More...
double estimate_field_rotation (double hour_angle, double field_rotation_rate)
 estimate_field_rotation Returns an estimation of the field rotation rate of the object More...
double parsec2m (double parsec)
 parsec2m Convert parallax arcseconds into meters More...
double m2au (double m)
 m2au Convert meters into astronomical units More...
double calc_delta_magnitude (double mag0, double mag, double *spectrum, int spectrum_size, int lambda)
 calc_delta_magnitude Returns the difference of magnitudes given two spectra More...
double estimate_absolute_magnitude (double dist, double delta_mag)
 estimate_field_rotation Returns an estimation of the field rotation rate of the object More...


const char * Direction []
const char * SolarSystem []

Detailed Description

Implementations for common driver routines.

The INDI Common Routine Library provides formatting and serial routines employed by many INDI drivers. Currently, the library is composed of the following sections:

Jason Harris
Elwood C. Downey
Jasem Mutlaq

Definition in file indicom.h.

Macro Definition Documentation


#define AIRY   1.21966

Definition at line 57 of file indicom.h.


#define ASTRONOMICALUNIT   1.495978707E+11

Definition at line 62 of file indicom.h.


#define CIRCLE_AM   (CIRCLE_DEG * 60)

Definition at line 59 of file indicom.h.


#define CIRCLE_AS   (CIRCLE_AM * 60)

Definition at line 60 of file indicom.h.


#define CIRCLE_DEG   360

Definition at line 58 of file indicom.h.



Definition at line 52 of file indicom.h.


#define EARTHRADIUSMEAN   6372797.0

Definition at line 54 of file indicom.h.


#define EARTHRADIUSPOLAR   6356752.0

Definition at line 53 of file indicom.h.


#define ERRMSG_SIZE   1024

Definition at line 45 of file indicom.h.


#define EULER   2.71828182845904523536028747135266249775724709369995

Definition at line 55 of file indicom.h.

◆ J2000

#define J2000   2451545.0

Definition at line 44 of file indicom.h.


#define LIGHTSPEED   299792458.0

Definition at line 64 of file indicom.h.

◆ LY

#define LY   (LIGHTSPEED * SOLAR_DAY * 365)

Definition at line 65 of file indicom.h.


#define PARSEC   (ASTRONOMICALUNIT*2.06264806247096E+5)

Definition at line 63 of file indicom.h.


#define RAD_AS   (CIRCLE_AS/(M_PI*2))

Definition at line 61 of file indicom.h.


#define ROOT2   1.41421356237309504880168872420969807856967187537694

Definition at line 56 of file indicom.h.


#define SOLAR_DAY   86400

Definition at line 49 of file indicom.h.


#define STELLAR_DAY   86164.098903691

Definition at line 47 of file indicom.h.


#define TRACKRATE_LUNAR   14.511415

Definition at line 51 of file indicom.h.


#define TRACKRATE_SIDEREAL   ((360.0 * 3600.0) / STELLAR_DAY)

Definition at line 48 of file indicom.h.


#define TRACKRATE_SOLAR   ((360.0 * 3600.0) / SOLAR_DAY)

Definition at line 50 of file indicom.h.

Enumeration Type Documentation



Definition at line 73 of file indicom.h.

Variable Documentation

◆ Direction

const char* Direction[]

◆ SolarSystem

const char* SolarSystem[]