Instrument Neutral Distributed Interface INDI 2.2.5
deepskydad_fp.cpp
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2015 Jasem Mutlaq. All rights reserved.
3
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2 of the License, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18
19 The full GNU General Public License is included in this distribution in the
20 file called LICENSE.
21*******************************************************************************/
22
23#include "deepskydad_fp.h"
24
25#include "indicom.h"
27
28#include <cerrno>
29#include <cstring>
30#include <memory>
31#include <termios.h>
32#include <unistd.h>
33#include <inttypes.h>
34#include <sys/ioctl.h>
35
36// We declare an auto pointer to DeepSkyDadFP.
37static std::unique_ptr<DeepSkyDadFP> dsdFp(new DeepSkyDadFP());
38
39#define FLAT_CMD 40
40#define FLAT_RES 40
41#define FLAT_TIMEOUT 3
42
47
49{
51
52 // Heater mode
53 IUFillSwitch(&HeaterModeS[Off], "OFF", "Off", ISS_OFF);
54 IUFillSwitch(&HeaterModeS[On], "ON", "On", ISS_OFF);
55 IUFillSwitch(&HeaterModeS[OnIfFlapOpenOrLedActive], "ON2", "On if flap open/LED active", ISS_OFF);
56 IUFillSwitchVector(&HeaterModeSP, HeaterModeS, 3, getDeviceName(), "Heater mode", "Heater mode", MAIN_CONTROL_TAB, IP_RW,
58
59 // Status
60 IUFillText(&StatusT[0], "Cover", "Cover", nullptr);
61 IUFillText(&StatusT[1], "Light", "Light", nullptr);
62 IUFillText(&StatusT[2], "Motor", "Motor", nullptr);
63 IUFillText(&StatusT[3], "Heater", "Heater", nullptr);
64 IUFillTextVector(&StatusTP, StatusT, 4, getDeviceName(), "Status", "Status", MAIN_CONTROL_TAB, IP_RO, 60, IPS_IDLE);
65
66 // Firmware version
67 IUFillText(&FirmwareT[0], "Version", "Version", nullptr);
68 IUFillTextVector(&FirmwareTP, FirmwareT, 1, getDeviceName(), "Firmware", "Firmware", MAIN_CONTROL_TAB, IP_RO, 60, IPS_IDLE);
69
72
73 LightIntensityNP[0].setMin(0);
74 LightIntensityNP[0].setMax(4096);
75 LightIntensityNP[0].setStep(1);
76
78
80
81 serialConnection = new Connection::Serial(this);
82 serialConnection->registerHandshake([&]()
83 {
84 return Handshake();
85 });
86 registerConnection(serialConnection);
87 serialConnection->setDefaultBaudRate(Connection::Serial::B_115200);
88 serialConnection->setPortMatchPattern("Deep_Sky_Dad_FP[0-9]");
89 return true;
90}
91
92void DeepSkyDadFP::ISGetProperties(const char *dev)
93{
95
96 // Get Light box properties
98}
99
101{
103
106
107 if (isConnected())
108 {
109 defineProperty(&HeaterModeSP);
110 defineProperty(&StatusTP);
111 defineProperty(&FirmwareTP);
112
113 getStartupData();
114 }
115 else
116 {
117 deleteProperty(HeaterModeSP.name);
118 deleteProperty(StatusTP.name);
119 deleteProperty(FirmwareTP.name);
120 }
121
122 return true;
123}
124
126{
127 return "Deep Sky Dad FP";
128}
129
130bool DeepSkyDadFP::Handshake()
131{
132 PortFD = serialConnection->getPortFD();
133 if (!ping())
134 {
135 LOG_ERROR("Device ping failed.");
136 return false;
137 }
138
141
142 return true;
143}
144
145bool DeepSkyDadFP::ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
146{
147 if (LI::processNumber(dev, name, values, names, n))
148 return true;
149
150 return INDI::DefaultDevice::ISNewNumber(dev, name, values, names, n);
151}
152
153bool DeepSkyDadFP::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
154{
155 if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
156 {
157 if (LI::processText(dev, name, texts, names, n))
158 return true;
159 }
160
161 return INDI::DefaultDevice::ISNewText(dev, name, texts, names, n);
162}
163
164bool DeepSkyDadFP::ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
165{
166 if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
167 {
168 if (DI::processSwitch(dev, name, states, names, n))
169 return true;
170
171 if (LI::processSwitch(dev, name, states, names, n))
172 return true;
173
174 if (strcmp(HeaterModeSP.name, name) == 0)
175 {
176 int current_mode = IUFindOnSwitchIndex(&HeaterModeSP);
177
178 IUUpdateSwitch(&HeaterModeSP, states, names, n);
179
180 int target_mode = IUFindOnSwitchIndex(&HeaterModeSP);
181
182 if (current_mode == target_mode)
183 {
184 HeaterModeSP.s = IPS_OK;
185 IDSetSwitch(&HeaterModeSP, nullptr);
186 return true;
187 }
188
189 char cmd[FLAT_RES] = {0};
190 char response[FLAT_RES] = {0};
191
192 snprintf(cmd, FLAT_RES, "[SHTM%d]", target_mode);
193 bool rc = sendCommand(cmd, response);
194 if (!rc)
195 {
196 IUResetSwitch(&HeaterModeSP);
197 HeaterModeS[current_mode].s = ISS_ON;
198 HeaterModeSP.s = IPS_ALERT;
199 IDSetSwitch(&HeaterModeSP, nullptr);
200 return false;
201 }
202
203 HeaterModeSP.s = IPS_OK;
204 IDSetSwitch(&HeaterModeSP, nullptr);
205 return true;
206 }
207 }
208
209 return INDI::DefaultDevice::ISNewSwitch(dev, name, states, names, n);
210}
211
213{
214 LI::snoop(root);
215
217}
218
220{
222
223 IUSaveConfigSwitch(fp, &HeaterModeSP);
224
225 return LI::saveConfigItems(fp);
226}
227
228bool DeepSkyDadFP::ping()
229{
230 char response[FLAT_RES] = {0};
231
232 if (!sendCommand("[GPOS]", response))
233 return false;
234
235 return true;
236}
237
239{
240 if (!isConnected())
241 return;
242
243 getStatus();
244
246}
247
248bool DeepSkyDadFP::getStartupData()
249{
250 bool rc1 = getFirmwareVersion();
251 bool rc2 = getStatus();
252 bool rc3 = getBrightness();
253
254 return (rc1 && rc2 && rc3);
255}
256
258{
259 char response[FLAT_RES];
260 if (!sendCommand("[STRG270]", response) || !sendCommand("[SMOV]", response))
261 return IPS_ALERT;
262
263 if (strcmp(response, "(OK)") == 0)
264 {
265 // Set cover status to random value outside of range to force it to refresh
266 prevCoverStatus = 10;
267 return IPS_BUSY;
268 }
269 else
270 return IPS_ALERT;
271}
272
274{
275 char response[FLAT_RES];
276 if (!sendCommand("[STRG0]", response) || !sendCommand("[SMOV]", response))
277 return IPS_ALERT;
278
279 if (strcmp(response, "(OK)") == 0)
280 {
281 // Set cover status to random value outside of range to force it to refresh
282 prevCoverStatus = 10;
283 return IPS_BUSY;
284 }
285 else
286 return IPS_ALERT;
287}
288
290{
291 char command[FLAT_CMD];
292 char response[FLAT_RES];
293
294 if (enable)
295 strncpy(command, "[SLON1]", FLAT_CMD);
296 else
297 strncpy(command, "[SLON0]", FLAT_CMD);
298
299 if (!sendCommand(command, response))
300 return false;
301
302 if (strcmp(response, "(OK)") == 0)
303 return true;
304
305 return false;
306}
307
308bool DeepSkyDadFP::getStatus()
309{
310 char response[FLAT_RES];
311
312 int motorStatus;
313 int lightStatus;
314 int coverStatus;
315 int heaterTemperature;
316 int heaterMode;
317
318 if (!sendCommand("[GMOV]", response))
319 return false;
320 else
321 sscanf(response, "(%d)", &motorStatus);
322
323 if (!sendCommand("[GLON]", response))
324 return false;
325 else
326 sscanf(response, "(%d)", &lightStatus);
327
328 if(isFP2)
329 {
330 if (!sendCommand("[GOPS]", response))
331 return false;
332 else
333 sscanf(response, "(%d)", &coverStatus);
334 }
335 else
336 {
337 if (!sendCommand("[GPOS]", response))
338 return false;
339 else
340 sscanf(response, "(%d)", &coverStatus);
341 }
342
343 if (!sendCommand("[GHTT]", response))
344 return false;
345 else
346 sscanf(response, "(%d)", &heaterTemperature);
347
348 if (!sendCommand("[GHTM]", response))
349 return false;
350 else
351 sscanf(response, "(%d)", &heaterMode);
352
353
354 bool statusUpdated = false;
355
356 if(isFP2)
357 {
358 if (coverStatus != prevCoverStatus)
359 {
360 if(motorStatus == 1)
361 {
362 if(coverStatus == 0)
363 {
364 IUSaveText(&StatusT[0], "Closed");
365 }
366 else if(coverStatus == 1)
367 {
368 IUSaveText(&StatusT[0], "Open");
369 }
370 else
371 {
372 IUSaveText(&StatusT[0], "Not open/closed");
373 }
374 }
375 else
376 {
377 prevCoverStatus = coverStatus;
378
379 statusUpdated = true;
380
381 if(coverStatus == 1)
382 {
383 IUSaveText(&StatusT[0], "Open");
384 if (ParkCapSP.getState() == IPS_BUSY || ParkCapSP.getState() == IPS_IDLE)
385 {
386 ParkCapSP.reset();
387 ParkCapSP[1].setState(ISS_ON);
388 ParkCapSP.setState(IPS_OK);
389 LOG_INFO("Cover open.");
390 ParkCapSP.apply();
391 }
392 }
393 else if(coverStatus == 0)
394 {
395 IUSaveText(&StatusT[0], "Closed");
396 if (ParkCapSP.getState() == IPS_BUSY || ParkCapSP.getState() == IPS_IDLE)
397 {
398 ParkCapSP.reset();
399 ParkCapSP[0].setState(ISS_ON);
400 ParkCapSP.setState(IPS_OK);
401 LOG_INFO("Cover closed.");
402 ParkCapSP.apply();
403 }
404 }
405 else
406 {
407 IUSaveText(&StatusT[0], "Not open/closed");
408 }
409 }
410 }
411 }
412 else
413 {
414 if (coverStatus != prevCoverStatus)
415 {
416 if(motorStatus == 1)
417 {
418 if(coverStatus == 0)
419 {
420 IUSaveText(&StatusT[0], "Open");
421 }
422 else if(coverStatus == 270)
423 {
424 IUSaveText(&StatusT[0], "Closed");
425 }
426 else
427 {
428 IUSaveText(&StatusT[0], "Not open/closed");
429 }
430 }
431 else
432 {
433 prevCoverStatus = coverStatus;
434
435 statusUpdated = true;
436
437 if(coverStatus == 0)
438 {
439 IUSaveText(&StatusT[0], "Open");
440 if (ParkCapSP.getState() == IPS_BUSY || ParkCapSP.getState() == IPS_IDLE)
441 {
442 ParkCapSP.reset();
443 ParkCapSP[1].setState(ISS_ON);
444 ParkCapSP.setState(IPS_OK);
445 LOG_INFO("Cover open.");
446 ParkCapSP.apply();
447 }
448 }
449 else if(coverStatus == 270)
450 {
451 IUSaveText(&StatusT[0], "Closed");
452 if (ParkCapSP.getState() == IPS_BUSY || ParkCapSP.getState() == IPS_IDLE)
453 {
454 ParkCapSP.reset();
455 ParkCapSP[0].setState(ISS_ON);
456 ParkCapSP.setState(IPS_OK);
457 LOG_INFO("Cover closed.");
458 ParkCapSP.apply();
459 }
460 }
461 else
462 {
463 IUSaveText(&StatusT[0], "Not open/closed");
464 }
465 }
466 }
467 }
468
469 if(motorStatus == 1)
470 {
471 IUSaveText(&StatusT[0], "Moving");
472 }
473
474 if (lightStatus != prevLightStatus)
475 {
476 prevLightStatus = lightStatus;
477
478 statusUpdated = true;
479
480 switch (lightStatus)
481 {
482 case 0:
483 IUSaveText(&StatusT[1], "Off");
484 LightSP[0].setState(ISS_OFF);
485 LightSP[1].setState(ISS_ON);
486 LightSP.apply();
487 break;
488
489 case 1:
490 IUSaveText(&StatusT[1], "On");
491 LightSP[0].setState(ISS_ON);
492 LightSP[1].setState(ISS_OFF);
493 LightSP.apply();
494 break;
495 }
496 }
497
498 if (motorStatus != prevMotorStatus)
499 {
500 prevMotorStatus = motorStatus;
501
502 statusUpdated = true;
503
504 switch (motorStatus)
505 {
506 case 0:
507 IUSaveText(&StatusT[2], "Stopped");
508 break;
509
510 case 1:
511 IUSaveText(&StatusT[2], "Running");
512 break;
513 }
514 }
515
516 if (statusUpdated)
517 IDSetText(&StatusTP, nullptr);
518
519 int heaterConnected = heaterTemperature > -40;
520 if(heaterConnected != prevHeaterConnected)
521 {
522 prevHeaterConnected = heaterConnected;
523 if(heaterConnected == 1)
524 {
525 IUSaveText(&StatusT[3], "Connected");
526 HeaterModeSP.s = IPS_OK;
527 }
528 else
529 {
530 HeaterModeSP.s = IPS_IDLE;
531 IUSaveText(&StatusT[3], "Disconnected");
532 }
533 }
534
535 if(heaterMode != prevHeaterMode)
536 {
537 prevHeaterMode = heaterMode;
538 IUResetSwitch(&HeaterModeSP);
539 if(heaterMode == 0)
540 {
541 HeaterModeS[0].s = ISS_ON;
542 }
543 else if(heaterMode == 1)
544 {
545 HeaterModeS[1].s = ISS_ON;
546 }
547 else if(heaterMode == 2)
548 {
549 HeaterModeS[2].s = ISS_ON;
550 }
551 IDSetSwitch(&HeaterModeSP, nullptr);
552 }
553
554 return true;
555}
556
557bool DeepSkyDadFP::getFirmwareVersion()
558{
559 char response[FLAT_RES] = {0};
560 if (!sendCommand("[GFRM]", response))
561 return false;
562
563 char versionString[6] = { 0 };
564 snprintf(versionString, 6, "%s", response + 31);
565 IUSaveText(&FirmwareT[0], response);
566 IDSetText(&FirmwareTP, nullptr);
567 isFP2 = strstr(response, "DeepSkyDad.FP2") != nullptr;
568
569 return true;
570}
571
572bool DeepSkyDadFP::getBrightness()
573{
574 char response[FLAT_RES] = {0};
575 if (!sendCommand("[GLBR]", response))
576 return false;
577
578 int32_t brightnessValue;
579 int rc = sscanf(response, "(%d)", &brightnessValue);
580
581 if (rc <= 0)
582 {
583 LOGF_ERROR("Unable to parse brightness value (%s)", response);
584 return false;
585 }
586
587 if (brightnessValue != prevBrightness)
588 {
589 prevBrightness = brightnessValue;
590 LightIntensityNP[0].setValue(brightnessValue);
591 LightIntensityNP.apply();
592 }
593
594 return true;
595}
596
598{
599 char command[FLAT_CMD] = {0};
600 char response[FLAT_RES] = {0};
601 snprintf(command, FLAT_CMD, "[SLBR%04d]", value);
602
603 if (!sendCommand(command, response))
604 return false;
605
606 if (strcmp(response, "(OK)") != 0)
607 {
608 LOGF_ERROR("Unable to set brightness value", response);
609 return false;
610 }
611
612 return true;
613}
614
615bool DeepSkyDadFP::sendCommand(const char *cmd, char *res)
616{
617 int nbytes_written = 0, nbytes_read = 0, rc = -1;
618
619 tcflush(PortFD, TCIOFLUSH);
620
621 LOGF_DEBUG("CMD <%s>", cmd);
622
623 if ((rc = tty_write_string(PortFD, cmd, &nbytes_written)) != TTY_OK)
624 {
625 char errstr[MAXRBUF] = {0};
626 tty_error_msg(rc, errstr, MAXRBUF);
627 LOGF_ERROR("Serial write error: %s.", errstr);
628 return false;
629 }
630
631 if (res == nullptr)
632 return true;
633
634 if ((rc = tty_nread_section(PortFD, res, FLAT_RES, ')', FLAT_TIMEOUT, &nbytes_read)) != TTY_OK)
635 {
636 char errstr[MAXRBUF] = {0};
637 tty_error_msg(rc, errstr, MAXRBUF);
638 LOGF_ERROR("Serial read error: %s.", errstr);
639 return false;
640 }
641
642 LOGF_DEBUG("RES <%s>", res);
643
644 tcflush(PortFD, TCIOFLUSH);
645
646 return true;
647}
#define FLAT_TIMEOUT
The Serial class manages connection with serial devices including Bluetooth. Serial communication is ...
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
virtual IPState UnParkCap() override
unPark dust cap (open cover). Must be implemented by child.
virtual bool SetLightBoxBrightness(uint16_t value) override
setBrightness Set light level. Must be implemented in the child class, if supported.
virtual bool ISSnoopDevice(XMLEle *root) override
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool EnableLightBox(bool enable) override
EnableLightBox Turn on/off on a light box. Must be implemented in the child class.
virtual IPState ParkCap() override
Park dust cap (close cover). Must be implemented by child.
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
const char * getDefaultName() override
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
bool isConnected() const
const char * getDeviceName() const
virtual bool updateProperties()
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process the client newSwitch command.
void registerConnection(Connection::Interface *newConnection)
registerConnection Add new connection plugin to the existing connection pool. The connection type sha...
virtual void ISGetProperties(const char *dev)
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual bool ISSnoopDevice(XMLEle *root)
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
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.
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
void defineProperty(INumberVectorProperty *property)
virtual bool saveConfigItems(FILE *fp)
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
uint32_t getCurrentPollingPeriod() const
getCurrentPollingPeriod Return the current polling period.
virtual bool initProperties()
Initialize properties initial state and value. The child class must implement this function.
void syncDriverInfo()
syncDriverInfo sends the current driver information to the client.
void addAuxControls()
Add Debug, Simulation, and Configuration options to the driver.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process the client newNumber command.
int SetTimer(uint32_t ms)
Set a timer to call the function TimerHit after ms milliseconds.
friend class LightBoxInterface
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process the client newSwitch command.
DustCapInterface(DefaultDevice *device)
INDI::PropertySwitch ParkCapSP
bool updateProperties()
updateProperties Defines or Delete properties based on default device connection status
void initProperties(const char *group, uint32_t capabilities=0)
Initialize dust cap properties. It is recommended to call this function within initProperties() of yo...
bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process dust cap switch properties.
void initProperties(const char *group, uint32_t capabilities)
Initialize light box properties. It is recommended to call this function within initProperties() of y...
void ISGetProperties(const char *deviceName)
isGetLightBoxProperties Get light box properties
INDI::PropertyNumber LightIntensityNP
bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process light box switch properties.
bool processText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process light box text properties.
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process light box number properties.
#define FLAT_CMD
#define FLAT_RES
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
ISState
Switch state.
Definition indiapi.h:148
@ ISS_OFF
Definition indiapi.h:149
@ ISS_ON
Definition indiapi.h:150
@ IP_RW
Definition indiapi.h:184
@ IP_RO
Definition indiapi.h:182
IPState
Property state.
Definition indiapi.h:158
@ IPS_BUSY
Definition indiapi.h:161
@ IPS_ALERT
Definition indiapi.h:162
@ IPS_IDLE
Definition indiapi.h:159
@ IPS_OK
Definition indiapi.h:160
@ ISR_1OFMANY
Definition indiapi.h:171
int tty_write_string(int fd, const char *buf, int *nbytes_written)
Writes a null terminated string to fd.
Definition indicom.c:473
void tty_error_msg(int err_code, char *err_msg, int err_msg_len)
Retrieve the tty error message.
Definition indicom.c:1243
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
Definition indicom.c:759
Implementations for common driver routines.
@ TTY_OK
Definition indicom.h:54
void IUSaveConfigSwitch(FILE *fp, const ISwitchVectorProperty *svp)
Add a switch vector property value to the configuration file.
Definition indidevapi.c:33
int IUFindOnSwitchIndex(const ISwitchVectorProperty *svp)
Returns the index of first ON switch it finds in the vector switch property.
Definition indidevapi.c:337
void IUResetSwitch(ISwitchVectorProperty *svp)
Reset all switches in a switch vector property to OFF.
Definition indidevapi.c:366
void IUFillTextVector(ITextVectorProperty *tvp, IText *tp, int ntp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a text vector property. The vector's auxiliary elements will be set to NULL.
Definition indidevapi.c:509
void IUSaveText(IText *tp, const char *newtext)
Function to reliably save new text in a IText.
Definition indidevapi.c:44
void IUFillSwitch(ISwitch *sp, const char *name, const char *label, ISState s)
Assign attributes for a switch property. The switch's auxiliary elements will be set to NULL.
Definition indidevapi.c:376
void IUFillText(IText *tp, const char *name, const char *label, const char *initialText)
Assign attributes for a text property. The text's auxiliary elements will be set to NULL.
Definition indidevapi.c:416
void IUFillSwitchVector(ISwitchVectorProperty *svp, ISwitch *sp, int nsp, const char *dev, const char *name, const char *label, const char *group, IPerm p, ISRule r, double timeout, IPState s)
Assign attributes for a switch vector property. The vector's auxiliary elements will be set to NULL.
Definition indidevapi.c:453
int IUUpdateSwitch(ISwitchVectorProperty *svp, ISState *states, char *names[], int n)
Update all switches in a switch vector property.
void IDSetSwitch(const ISwitchVectorProperty *svp, const char *fmt,...)
#define MAXRBUF
Definition indidriver.c:52
void IDSetText(const ITextVectorProperty *tvp, const char *fmt,...)
*brief user defined string literal for JSON values *sa std::size_t n
#define LOGF_DEBUG(fmt,...)
Definition indilogger.h:83
#define LOG_ERROR(txt)
Shorter logging macros. In order to use these macros, the function (or method) "getDeviceName()" must...
Definition indilogger.h:72
#define LOGF_ERROR(fmt,...)
Definition indilogger.h:80
#define LOG_INFO(txt)
Definition indilogger.h:74
struct xml_ele_ XMLEle
Definition lilxml.h:81
uint8_t cmd[4]
Definition pwc-ioctl.h:2