129 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
130 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
131 virtual bool ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n)
override;
136 virtual bool SetPowerPort(
size_t port,
bool enabled)
override;
137 virtual bool SetDewPort(
size_t port,
bool enabled,
double dutyCycle)
override;
138 virtual bool SetVariablePort(
size_t port,
bool enabled,
double voltage)
override;
142 virtual bool SetUSBPort(
size_t port,
bool enabled)
override;
184 enum CheapoDCLocation
186 LOCATION_LATITUDE = 0,
198 ACTIVE_TELESCOPE = 0,
203 enum controllerPinModes
205 CONTROLLER_PIN_MODE_DISABLED = 0,
206 CONTROLLER_PIN_MODE_CONTROLLER,
207 CONTROLLER_PIN_MODE_PWM,
208 CONTROLLER_PIN_MODE_BOOLEAN,
212 const char* pinModeText[MAX_PIN_MODES] = {
"Disabled",
"Controller",
"PWM",
"Boolean"};
213 const char* channelLabels[MAX_PIN_MODES] = {
"Output %d (Disabled)",
"Output %d (Controller)",
214 "Output %d (PWM)",
"Output %d (On/Off)"};
219 CONTROLLER_PIN_MODE_DISABLED, CONTROLLER_PIN_MODE_DISABLED };
221 bool fwVOneDetected =
false;
222 bool internalHumiditySensorSupported =
false;
223 bool additionalOutputsSupported =
false;
224 int fwMajorVersion = 0;
225 int fwMinorVersion = 0;
226 int fwPatchVersion = 0;
228 unsigned int previousControllerMode = MANUAL;
229 unsigned int prevMinOutput = 0;
230 unsigned int prevMaxOutput = 100;
231 unsigned int previousTemperatureMode = WEATHER_QUERY;
232 char activeTelescopeDevice[
MAXINDINAME] = {
"Telescope Simulator"};
233 char activeFocuserDevice[
MAXINDINAME] = {
"Focuser Simulator"};
234 char activeWeatherDevice[
MAXINDINAME] = {
"Weather Simulator"};
235 bool usingExternalWeatherSource =
false;
236 bool previuoslyUsingExternalWeatherSource = usingExternalWeatherSource;
238 int msleep(
long duration);
239 bool sendCommand(
const char *
cmd,
char *response);
240 bool sendGetCommand(
const char *
cmd,
char *resp);
241 bool sendSetCommand(
const char *
cmd,
char *value);
245 void refreshSettings(
bool delayRefresh =
false);
246 void getWeatherSource();
247 bool setWeatherSource(
int value);
248 bool setControllerMode(
int value);
249 bool setTemperatureMode(
int value);
250 bool setSetPointMode(
int value);
251 bool setSetPoint(
float value);
252 bool setTrackPointOffset(
float value);
253 bool setTrackingRange(
float value);
254 bool setOutput(
int value);
255 bool setMinimumOutput(
int value);
256 bool setMaximumOutput(
int value);
257 bool setUpdateOutputEvery(
int value);
258 bool setWeatherQueryEvery(
int value);
259 bool setWeatherQueryAPIKey(
const char *key);
260 bool setWeatherQueryEnabled(
bool enabled);
261 bool setUTCOffset(
int offset);
262 bool setLatitude(
float value);
263 bool setLongitude(
float value);
264 bool setLocation(
float latitude,
float longitude);
265 bool setExternalTemperature(
float value);
266 bool setWeatherTemperature(
float value);
267 bool setWeatherHumidity(
float value);
268 bool setSnoopLocationDevice(
const char *
device,
const char *property,
const char *latAttribute,
const char *lonAttribute);
269 bool setSnoopTemperatureDevice(
const char *
device,
const char *property,
const char *attribute);
270 bool setSnoopWeatherDevice(
const char *
device,
const char *property,
const char *temperatureAttribute,
271 const char *humidityAttribute);
272 void setActiveDevice(
const char *telescopeDevice,
const char *focuserDevice,
const char *weatherDevice);
273 bool setAdditionalOutput(
int outputPin,
int output );
274 bool checkOutputConfiguration();
277 Connection::TCP *tcpConnection{
nullptr};
284 static const uint8_t CDC_READ_TIMEOUT{10};
285 static const long CDC_SMALL_DELAY{50};
287 INDI::PropertyNumber OutputPowerNP{1};
288 INDI::PropertyNumber MinimumOutputNP{1};
289 INDI::PropertyNumber MaximumOutputNP{1};
290 INDI::PropertySwitch TemperatureModeSP{2};
291 INDI::PropertySwitch SetPointModeSP{3};
292 INDI::PropertyNumber XtrnTemperatureNP{2};
293 INDI::PropertyNumber HumidityNP{1};
294 INDI::PropertyNumber DewpointNP{1};
295 INDI::PropertyNumber SetPointTemperatureNP{1};
296 INDI::PropertyNumber TrackPointOffsetNP{1};
297 INDI::PropertyNumber TrackingRangeNP{1};
298 INDI::PropertyNumber UpdateOutputEveryNP{1};
299 INDI::PropertyNumber QueryWeatherEveryNP{1};
300 INDI::PropertySwitch WeatherSourceSP{4};
301 INDI::PropertyText WeatherQueryAPIKeyTP{1};
302 INDI::PropertyText WeatherUpdatedTP{1};
303 INDI::PropertyNumber LocationNP{2};
304 INDI::PropertyText FWversionTP{1};
305 INDI::PropertySwitch RefreshSP{1};
306 INDI::PropertyText DeviceTimeTP{2};
307 INDI::PropertyText ActiveDeviceTP{3};
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.