41 return (
const char *)
"GPS Simulator";
79 LOG_INFO(
"Values are updated and should be active on the next GPS update.");
91 static char ts[32] = {0};
92 struct tm *utc, *local;
99 utc = gmtime(&raw_time);
100 strftime(ts,
sizeof(ts),
"%Y-%m-%dT%H:%M:%S", utc);
103 local = localtime(&raw_time);
104 snprintf(ts,
sizeof(ts),
"%4.2f", (local->tm_gmtoff / 3600.0));
The GPSSimulator class provides a simple simulator that provide GPS Time and Location services.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save refresh period
virtual IPState updateGPS() override
updateGPS Retrieve Location & Time from GPS. Update LocationNP & TimeTP properties (value and state) ...
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
const char * getDefaultName() override
bool Disconnect() override
Disconnect from device.
const char * getDeviceName() const
void setDriverInterface(uint32_t value)
setInterface Set driver interface. By default the driver interface is set to GENERAL_DEVICE....
void setVersion(uint16_t vMajor, uint16_t vMinor)
Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.
INDI::PropertyNumber LocationNP
DefaultDevice * m_DefaultDevice
INDI::PropertyText TimeTP
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save refresh period
void setState(IPState state)
void apply(const char *format,...) const ATTRIBUTE_FORMAT_PRINTF(2
void save(FILE *f) const
save Save property to configuration file.
bool isNameMatch(const char *otherName) const
bool update(const double values[], const char *const names[], int n)
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, double timeout, IPState state)
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
std::unique_ptr< GPSSimulator > gpsSimulator(new GPSSimulator())