Instrument Neutral Distributed Interface INDI 2.2.5
Public Types | Protected Types | Protected Member Functions | Protected Attributes | List of all members
INDI::GPSInterface Class Reference

Provides interface to implement GPS functionality. More...

#include <indigpsinterface.h>

Inheritance diagram for INDI::GPSInterface:
INDI::GPS GPSSimulator UranusMeteo

Public Types

enum  GPSLocation { LOCATION_LATITUDE , LOCATION_LONGITUDE , LOCATION_ELEVATION }
 

Protected Types

enum  { UPDATE_NEVER , UPDATE_ON_STARTUP , UPDATE_ON_REFRESH }
 

Protected Member Functions

 GPSInterface (DefaultDevice *defaultDevice)
 
virtual ~GPSInterface ()=default
 
void initProperties (const char *groupName)
 Initialize focuser properties. It is recommended to call this function within initProperties() of your primary device.
 
bool updateProperties ()
 updateProperties Define or Delete Rotator properties based on the connection status of the base device
 
bool processNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process focus number properties.
 
bool processSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process focus switch properties.
 
virtual bool saveConfigItems (FILE *fp)
 saveConfigItems save focuser properties defined in the interface in config file
 
void checkGPSState ()
 checkGPSState Check and update GPS state
 
bool setSystemTime (time_t &raw_time)
 SetSystemTime Update system-wide time.
 
virtual IPState updateGPS ()
 updateGPS Retrieve Location & Time from GPS. Update LocationNP & TimeTP properties (value and state) without sending them to the client (i.e. IDSetXXX).
 

Protected Attributes

INDI::PropertyNumber LocationNP {3}
 
INDI::PropertyText TimeTP {2}
 
INDI::PropertySwitch RefreshSP {1}
 
INDI::PropertyNumber PeriodNP {1}
 
INDI::PropertySwitch SystemTimeUpdateSP {3}
 
INDI::Timer m_UpdateTimer
 
std::time_t m_GPSTime
 
bool m_SystemTimeUpdated {false}
 
bool m_NTPDisabledByGPS { false }
 
DefaultDevice * m_DefaultDevice { nullptr }
 

Detailed Description

Provides interface to implement GPS functionality.

Author
Jasem Mutlaq

Definition at line 45 of file indigpsinterface.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
UPDATE_NEVER 
UPDATE_ON_STARTUP 
UPDATE_ON_REFRESH 

Definition at line 151 of file indigpsinterface.h.

◆ GPSLocation

Enumerator
LOCATION_LATITUDE 
LOCATION_LONGITUDE 
LOCATION_ELEVATION 

Definition at line 48 of file indigpsinterface.h.

Constructor & Destructor Documentation

◆ GPSInterface()

INDI::GPSInterface::GPSInterface ( DefaultDevice *  defaultDevice)
explicitprotected

Definition at line 43 of file indigpsinterface.cpp.

◆ ~GPSInterface()

virtual INDI::GPSInterface::~GPSInterface ( )
protectedvirtualdefault

Member Function Documentation

◆ checkGPSState()

void INDI::GPSInterface::checkGPSState ( )
protected

checkGPSState Check and update GPS state

Definition at line 89 of file indigpsinterface.cpp.

◆ initProperties()

void INDI::GPSInterface::initProperties ( const char *  groupName)
protected

Initialize focuser properties. It is recommended to call this function within initProperties() of your primary device.

Parameters
groupNameGroup or tab name to be used to define focuser properties.

Definition at line 52 of file indigpsinterface.cpp.

◆ processNumber()

bool INDI::GPSInterface::processNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)
protected

Process focus number properties.

Definition at line 204 of file indigpsinterface.cpp.

◆ processSwitch()

bool INDI::GPSInterface::processSwitch ( const char *  dev,
const char *  name,
ISState *  states,
char *  names[],
int  n 
)
protected

Process focus switch properties.

Definition at line 248 of file indigpsinterface.cpp.

◆ saveConfigItems()

bool INDI::GPSInterface::saveConfigItems ( FILE *  fp)
protectedvirtual

saveConfigItems save focuser properties defined in the interface in config file

Parameters
fppointer to config file
Returns
Always return true

Reimplemented in GPSSimulator, UranusMeteo, and INDI::GPS.

Definition at line 491 of file indigpsinterface.cpp.

◆ setSystemTime()

bool INDI::GPSInterface::setSystemTime ( time_t &  raw_time)
protected

SetSystemTime Update system-wide time.

Parameters
raw_timeraw time
Returns
true if successful, false other.
Note
Process user must have permission to set time.

Definition at line 281 of file indigpsinterface.cpp.

◆ updateGPS()

IPState INDI::GPSInterface::updateGPS ( )
protectedvirtual

updateGPS Retrieve Location & Time from GPS. Update LocationNP & TimeTP properties (value and state) without sending them to the client (i.e. IDSetXXX).

Returns
Return overall state. The state should be IPS_OK if data is valid. IPS_BUSY if GPS fix is in progress. IPS_ALERT is there is an error. The clients will only accept values with IPS_OK state.

Reimplemented in GPSSimulator, and UranusMeteo.

Definition at line 483 of file indigpsinterface.cpp.

◆ updateProperties()

bool INDI::GPSInterface::updateProperties ( )
protected

updateProperties Define or Delete Rotator properties based on the connection status of the base device

Returns
True if successful, false otherwise.

Definition at line 152 of file indigpsinterface.cpp.

Member Data Documentation

◆ LocationNP

INDI::PropertyNumber INDI::GPSInterface::LocationNP {3}
protected

Definition at line 138 of file indigpsinterface.h.

◆ m_DefaultDevice

DefaultDevice* INDI::GPSInterface::m_DefaultDevice { nullptr }
protected

Definition at line 169 of file indigpsinterface.h.

◆ m_GPSTime

std::time_t INDI::GPSInterface::m_GPSTime
protected

Definition at line 161 of file indigpsinterface.h.

◆ m_NTPDisabledByGPS

bool INDI::GPSInterface::m_NTPDisabledByGPS { false }
protected

Definition at line 167 of file indigpsinterface.h.

◆ m_SystemTimeUpdated

bool INDI::GPSInterface::m_SystemTimeUpdated {false}
protected

Definition at line 164 of file indigpsinterface.h.

◆ m_UpdateTimer

INDI::Timer INDI::GPSInterface::m_UpdateTimer
protected

Definition at line 158 of file indigpsinterface.h.

◆ PeriodNP

INDI::PropertyNumber INDI::GPSInterface::PeriodNP {1}
protected

Definition at line 147 of file indigpsinterface.h.

◆ RefreshSP

INDI::PropertySwitch INDI::GPSInterface::RefreshSP {1}
protected

Definition at line 144 of file indigpsinterface.h.

◆ SystemTimeUpdateSP

INDI::PropertySwitch INDI::GPSInterface::SystemTimeUpdateSP {3}
protected

Definition at line 150 of file indigpsinterface.h.

◆ TimeTP

INDI::PropertyText INDI::GPSInterface::TimeTP {2}
protected

Definition at line 141 of file indigpsinterface.h.


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