35#ifdef _USE_SYSTEM_JSONLIB
36#include <nlohmann/json.hpp>
51 virtual bool ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n)
override;
52 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
54 virtual bool loadConfig(
bool silent =
false,
const char *property =
nullptr)
override;
68 void updateUPSStatus();
71 bool queryUPSStatus();
72 bool parseUPSResponse(
const std::string& response);
73 std::string makeNUTRequest(
const std::string& command);
82 INDI::PropertyNumber UpdatePeriodNP {1};
85 INDI::PropertyNumber UPSParametersNP {3};
93 INDI::PropertyLight SafetyStatusLP {1};
96 INDI::PropertyNumber BatteryThresholdsNP {2};
98 BATTERY_WARNING_THRESHOLD,
99 BATTERY_CRITICAL_THRESHOLD
103 std::map<std::string, std::string> upsParameters;
106 Connection::TCP *tcpConnection {
nullptr};
109 bool LastParseSuccess {
false};
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
bool Disconnect() override
Disconnect from device.
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual bool loadConfig(bool silent=false, const char *property=nullptr) override
Load the last saved configuration file.
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
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.
const char * getDefaultName() override
*brief user defined string literal for JSON values *sa std::size_t n