32#include <libnova/julian_day.h>
40#include <netinet/in.h>
41#include <sys/socket.h>
43#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
51constexpr unsigned short SKYFI_DISCOVERY_PORT = 4031;
52constexpr unsigned short SKYSAFARI_DEFAULT_PORT = 9624;
57static std::unique_ptr<SkySafari> tommyGoodBoy(
new SkySafari());
74 bool rc = startServer();
77 skySafariClient->setMount(ActiveDeviceT[ACTIVE_TELESCOPE].text);
78 skySafariClient->setServer(SettingsT[INDISERVER_HOST].text, std::stoi(SettingsT[INDISERVER_PORT].text));
79 skySafariClient->connectServer();
95 IUFillText(&SettingsT[INDISERVER_HOST],
"INDISERVER_HOST",
"indiserver host",
"localhost");
96 IUFillText(&SettingsT[INDISERVER_PORT],
"INDISERVER_PORT",
"indiserver port",
"7624");
97 IUFillText(&SettingsT[SKYSAFARI_PORT],
"SKYSAFARI_PORT",
"SkySafari port",
"9624");
107 IUFillSwitch(&SkyFiDiscoveryS[SKYFI_DISCOVERY_ENABLE],
"SKYFI_DISCOVERY_ENABLE",
"Discoverable as SkyFi",
ISS_OFF);
108 IUFillSwitch(&SkyFiDiscoveryS[SKYFI_DISCOVERY_DISABLE],
"SKYFI_DISCOVERY_DISABLE",
"Disabled",
ISS_ON);
112 IUFillText(&ActiveDeviceT[ACTIVE_TELESCOPE],
"ACTIVE_TELESCOPE",
"Telescope",
"Telescope Simulator");
126 DefaultDevice::ISGetProperties(dev);
139 if (!strcmp(SettingsTP.name, name))
147 if (!strcmp(ActiveDeviceTP.name, name))
150 ActiveDeviceTP.s =
IPS_OK;
163 if (!strcmp(SkyFiDiscoverySP.name, name))
166 SkyFiDiscoverySP.s =
IPS_OK;
168 if (SkyFiDiscoveryS[SKYFI_DISCOVERY_ENABLE].s ==
ISS_ON)
177 if (!strcmp(ServerControlSP.name, name))
184 if (ServerControlS[SERVER_ENABLE].s ==
ISS_ON)
186 ServerControlSP.s =
IPS_OK;
199 if (ServerControlS[SERVER_DISABLE].s ==
ISS_ON)
217 return DefaultDevice::ISNewSwitch(dev, name, states, names,
n);
238 struct sockaddr_in cli_socket;
243 cli_len =
sizeof(cli_socket);
244 cli_fd = accept(lsocket, (
struct sockaddr *)&cli_socket, &cli_len);
245 if (cli_fd < 0 && (
errno == EAGAIN ||
errno == EWOULDBLOCK))
262 if ((flags = fcntl(clientFD, F_GETFL, 0)) < 0)
264 LOGF_ERROR(
"Error connecting to SkySafari. F_GETFL: %s", strerror(
errno));
268 if (fcntl(clientFD, F_SETFL, flags | O_NONBLOCK) < 0)
270 LOGF_ERROR(
"Error connecting to SkySafari. F_SETFL: %s", strerror(
errno));
274 if (isSkySafariConnected ==
false)
276 LOG_INFO(
"Connected to SkySafari.");
277 isSkySafariConnected =
true;
283 char buffer[64] = { 0 };
284 int rc = read(clientFD, buffer, 64);
287 std::vector<std::string> commands = split(buffer,
'#');
288 for (std::string
cmd : commands)
309bool SkySafari::startServer()
311 struct sockaddr_in serv_socket;
315 const unsigned short requestedPort =
static_cast<unsigned short>(atoi(SettingsT[SKYSAFARI_PORT].text));
318 if ((sfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
325 if ((flags = fcntl(sfd, F_GETFL, 0)) < 0)
331 if (fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0)
337 memset(&serv_socket, 0,
sizeof(serv_socket));
338 serv_socket.sin_family = AF_INET;
339 serv_socket.sin_addr.s_addr = htonl(INADDR_ANY);
340 serv_socket.sin_port = htons(requestedPort);
341 if (setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &reuse,
sizeof(reuse)) < 0)
347 if (::bind(sfd, (
struct sockaddr *)&serv_socket,
sizeof(serv_socket)) < 0)
354 if (listen(sfd, 5) < 0)
361 serverPort = requestedPort;
362 if (SkyFiDiscoveryS[SKYFI_DISCOVERY_ENABLE].s ==
ISS_ON)
366 "SkySafari Server is running. Connect the App now to this machine using SkySafari LX200 driver.");
370bool SkySafari::stopServer()
379 clientFD = lsocket = -1;
385bool SkySafari::startDiscovery()
387 if (discoverySocket >= 0)
393 if (serverPort != SKYSAFARI_DEFAULT_PORT)
395 LOGF_WARN(
"SkyFi discovery requires SkySafari TCP port %hu; discovery is disabled for port %hu.",
396 SKYSAFARI_DEFAULT_PORT, serverPort);
400#if !defined(IP_PKTINFO) && !defined(IP_RECVDSTADDR)
401 LOG_WARN(
"SkyFi discovery is unavailable because this platform cannot identify the receiving interface.");
405 int sfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
408 LOGF_WARN(
"Unable to create SkyFi discovery socket: %s", strerror(
errno));
412 int flags = fcntl(sfd, F_GETFL, 0);
413 if (flags < 0 || fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0)
415 LOGF_WARN(
"Unable to make SkyFi discovery socket non-blocking: %s", strerror(
errno));
420 int receivePacketInfo = 1;
421#if defined(IP_PKTINFO)
422 if (setsockopt(sfd, IPPROTO_IP, IP_PKTINFO, &receivePacketInfo,
sizeof(receivePacketInfo)) < 0)
424 LOGF_WARN(
"Unable to obtain SkyFi discovery interface information: %s", strerror(
errno));
428#elif defined(IP_RECVDSTADDR)
429 if (setsockopt(sfd, IPPROTO_IP, IP_RECVDSTADDR, &receivePacketInfo,
sizeof(receivePacketInfo)) < 0)
431 LOGF_WARN(
"Unable to obtain SkyFi discovery destination information: %s", strerror(
errno));
436 if (setsockopt(sfd, IPPROTO_IP, IP_RECVIF, &receivePacketInfo,
sizeof(receivePacketInfo)) < 0)
438 LOGF_WARN(
"Unable to obtain SkyFi discovery interface information: %s", strerror(
errno));
445 struct sockaddr_in discoveryAddress {};
446 discoveryAddress.sin_family = AF_INET;
447 discoveryAddress.sin_addr.s_addr = htonl(INADDR_ANY);
448 discoveryAddress.sin_port = htons(SKYFI_DISCOVERY_PORT);
449 if (::bind(sfd,
reinterpret_cast<struct sockaddr *
>(&discoveryAddress),
sizeof(discoveryAddress)) < 0)
451 LOGF_WARN(
"Unable to bind SkyFi discovery port %hu: %s", SKYFI_DISCOVERY_PORT, strerror(
errno));
456 discoverySocket = sfd;
457 LOGF_INFO(
"SkyFi discovery is listening on UDP port %hu.", SKYFI_DISCOVERY_PORT);
461void SkySafari::stopDiscovery()
463 if (discoverySocket >= 0)
465 close(discoverySocket);
466 discoverySocket = -1;
470void SkySafari::handleDiscovery()
472 if (discoverySocket < 0)
475 for (
int i = 0; i < 16; ++i)
478 alignas(
struct cmsghdr) char control[512] {};
479 struct sockaddr_in clientAddress {};
480 struct iovec data {};
481 data.iov_base = query;
482 data.iov_len =
sizeof(query);
484 struct msghdr message {};
485 message.msg_name = &clientAddress;
486 message.msg_namelen =
sizeof(clientAddress);
487 message.msg_iov = &data;
488 message.msg_iovlen = 1;
489 message.msg_control = control;
490 message.msg_controllen =
sizeof(control);
492 ssize_t queryLength = recvmsg(discoverySocket, &message, 0);
496 LOGF_WARN(
"Error receiving SkyFi discovery request: %s", strerror(
errno));
500 if (queryLength == 0 || (message.msg_flags & (MSG_TRUNC | MSG_CTRUNC)))
503 if (query[queryLength - 1] !=
'?')
505 LOG_DEBUG(
"Ignoring invalid SkyFi discovery request without a trailing question mark.");
509 struct in_addr localAddress {};
510 bool haveLocalAddress =
false;
511#if defined(IP_PKTINFO)
512 for (
struct cmsghdr *cmsg = CMSG_FIRSTHDR(&message); cmsg !=
nullptr; cmsg = CMSG_NXTHDR(&message, cmsg))
514 if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_PKTINFO
515 && cmsg->cmsg_len >= CMSG_LEN(
sizeof(
struct in_pktinfo)))
517 const auto *packetInfo =
reinterpret_cast<const struct in_pktinfo *
>(CMSG_DATA(cmsg));
518 localAddress = packetInfo->ipi_spec_dst;
519 haveLocalAddress =
true;
523#elif defined(IP_RECVDSTADDR)
524 unsigned int interfaceIndex = 0;
525 for (
struct cmsghdr *cmsg = CMSG_FIRSTHDR(&message); cmsg !=
nullptr; cmsg = CMSG_NXTHDR(&message, cmsg))
528 if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_RECVIF
529 && cmsg->cmsg_len >= CMSG_LEN(
sizeof(
struct sockaddr_dl)))
531 const auto *interfaceAddress =
reinterpret_cast<const struct sockaddr_dl *
>(CMSG_DATA(cmsg));
532 interfaceIndex = interfaceAddress->sdl_index;
535 if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_RECVDSTADDR
536 && cmsg->cmsg_len >= CMSG_LEN(
sizeof(
struct in_addr)))
538 const auto *destination =
reinterpret_cast<const struct in_addr *
>(CMSG_DATA(cmsg));
539 localAddress = *destination;
540 haveLocalAddress =
true;
544#if defined(IP_RECVIF) && (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__))
545 if (interfaceIndex != 0)
548 struct ifaddrs *interfaces =
nullptr;
549 if (getifaddrs(&interfaces) < 0)
551 LOGF_WARN(
"Unable to look up SkyFi discovery interface address: %s", strerror(
errno));
555 haveLocalAddress =
false;
556 for (
struct ifaddrs *interface = interfaces;
interface !=
nullptr;
interface = interface->ifa_next)
558 if (interface->ifa_addr !=
nullptr && interface->ifa_addr->sa_family == AF_INET
559 && if_nametoindex(interface->ifa_name) == interfaceIndex)
561 const auto *interfaceAddress = reinterpret_cast<const struct sockaddr_in *>(interface->ifa_addr);
562 localAddress = interfaceAddress->sin_addr;
563 haveLocalAddress = true;
567 freeifaddrs(interfaces);
572 if (!haveLocalAddress)
574 LOG_WARN(
"Unable to determine local address for SkyFi discovery request.");
578 char localAddressText[INET_ADDRSTRLEN];
579 if (inet_ntop(AF_INET, &localAddress, localAddressText,
sizeof(localAddressText)) ==
nullptr)
581 LOGF_WARN(
"Unable to format SkyFi discovery interface address: %s", strerror(
errno));
585 std::string response(query,
static_cast<size_t>(queryLength - 1));
587 response += localAddressText;
588 ssize_t sent = sendto(discoverySocket, response.data(), response.size(), 0,
589 reinterpret_cast<struct sockaddr *
>(&clientAddress), message.msg_namelen);
591 LOGF_WARN(
"Error replying to SkyFi discovery request: %s", strerror(
errno));
592 else if (
static_cast<size_t>(sent) != response.size())
593 LOG_WARN(
"Incomplete reply to SkyFi discovery request.");
597void SkySafari::processCommand(std::string
cmd)
601 if (skySafariClient->isConnected() ==
false)
603 LOG_ERROR(
"Internal client is not connected! Please make sure the mount name is set in the Options tab. Disconnect and reconnect to try again.");
608 if (
cmd.compare(0, 2,
"St") == 0)
611 if (sscanf(
cmd.c_str(),
"St%d%*c%d", &dd, &mm) == 2)
614 siteLatitude = dd + mm / 60.0;
621 sendGeographicCoords();
624 else if (
cmd.compare(0, 2,
"Sg") == 0)
627 if (sscanf(
cmd.c_str(),
"Sg%d%*c%d", &ddd, &mm) == 2)
629 haveLongitude =
true;
630 siteLongitude = ddd + mm / 60.0;
633 siteLongitude = 360 - siteLongitude;
640 sendGeographicCoords();
643 else if (
cmd.compare(0, 2,
"SG") == 0)
646 if (sscanf(
cmd.c_str(),
"SG%d", &ofs) == 1)
652 haveUTCoffset =
true;
662 else if (
cmd.compare(0, 2,
"SL") == 0)
665 if (sscanf(
cmd.c_str(),
"SL%d:%d:%d", &hh, &mm, &ss) == 3)
667 LOGF_DEBUG(
"TIME : %02d:%02d:%02d", hh, mm, ss);
682 else if (
cmd.compare(0, 2,
"SC") == 0)
685 if (sscanf(
cmd.c_str(),
"SC%d/%d/%d", &mm, &dd, &yyyy) == 3)
687 LOGF_DEBUG(
"DATE : %02d-%02d-%02d", yyyy, mm, dd);
702 else if (
cmd ==
"GR")
704 auto eqCoordsNP = skySafariClient->getEquatorialCoords();
705 if (eqCoordsNP ==
nullptr)
707 LOG_WARN(
"Unable to communicate with mount, is mount turned on and connected?");
712 char output[32] = { 0 };
714 snprintf(output, 32,
"%02d:%02d:%02d#", hh, mm, ss);
715 sendSkySafari(output);
718 else if (
cmd ==
"GD")
720 auto eqCoordsNP = skySafariClient->getEquatorialCoords();
721 if (eqCoordsNP ==
nullptr)
723 LOG_WARN(
"Unable to communicate with mount, is mount turned on and connected?");
727 char output[32] = { 0 };
729 snprintf(output, 32,
"%c%02d:%02d:%02d#", (eqCoordsNP->at(
AXIS_DE)->getValue() >= 0) ?
'+' :
'-',
730 std::abs(dd), mm, ss);
731 sendSkySafari(output);
734 else if (
cmd.compare(0, 2,
"Sr") == 0)
741 else if (
cmd.compare(0, 2,
"Sd") == 0)
748 else if (
cmd ==
"MS")
750 auto gotoModeSP = skySafariClient->getGotoMode();
751 if (gotoModeSP ==
nullptr)
753 sendSkySafari(
"2<Not Supported>#");
758 auto trackSW = gotoModeSP->findWidgetByName(
"TRACK");
759 if (trackSW ==
nullptr)
761 sendSkySafari(
"2<Not Supported>#");
766 trackSW->setState(
ISS_ON);
767 skySafariClient->sendGotoMode();
769 auto eqCoordsNP = skySafariClient->getEquatorialCoords();
770 eqCoordsNP->at(
AXIS_RA)->setValue(RA);
771 eqCoordsNP->at(
AXIS_DE)->setValue(DE);
772 skySafariClient->sendEquatorialCoords();
777 else if (
cmd ==
"CM")
779 auto gotoModeSP = skySafariClient->getGotoMode();
780 if (gotoModeSP ==
nullptr)
782 sendSkySafari(
"Not Supported#");
787 auto syncSW = gotoModeSP->findWidgetByName(
"SYNC");
788 if (syncSW ==
nullptr)
790 sendSkySafari(
"Not Supported#");
796 skySafariClient->sendGotoMode();
798 auto eqCoordsNP = skySafariClient->getEquatorialCoords();
799 eqCoordsNP->at(
AXIS_RA)->setValue(RA);
800 eqCoordsNP->at(
AXIS_DE)->setValue(DE);
801 skySafariClient->sendEquatorialCoords();
803 sendSkySafari(
" M31 EX GAL MAG 3.5 SZ178.0'#");
808 skySafariClient->abort();
811 else if (
cmd ==
"RG")
813 skySafariClient->setSlewRate(0);
816 else if (
cmd ==
"RC")
818 skySafariClient->setSlewRate(1);
821 else if (
cmd ==
"RM")
823 skySafariClient->setSlewRate(2);
826 else if (
cmd ==
"RS")
828 skySafariClient->setSlewRate(3);
831 else if (
cmd ==
"Mn")
833 auto motionNSNP = skySafariClient->getMotionNS();
837 motionNSNP->at(0)->setState(
ISS_ON);
838 skySafariClient->setMotionNS();
842 else if (
cmd ==
"Qn")
844 auto motionNSNP = skySafariClient->getMotionNS();
848 skySafariClient->setMotionNS();
852 else if (
cmd ==
"Ms")
854 auto motionNSNP = skySafariClient->getMotionNS();
858 motionNSNP->at(1)->setState(
ISS_ON);
859 skySafariClient->setMotionNS();
863 else if (
cmd ==
"Qs")
865 auto motionNSNP = skySafariClient->getMotionNS();
869 skySafariClient->setMotionNS();
873 else if (
cmd ==
"Mw")
875 auto motionWENP = skySafariClient->getMotionWE();
879 motionWENP->at(0)->setState(
ISS_ON);
880 skySafariClient->setMotionWE();
884 else if (
cmd ==
"Qw")
886 auto motionWENP = skySafariClient->getMotionWE();
890 skySafariClient->setMotionWE();
894 else if (
cmd ==
"Me")
896 auto motionWENP = skySafariClient->getMotionWE();
900 motionWENP->at(1)->setState(
ISS_ON);
901 skySafariClient->setMotionWE();
905 else if (
cmd ==
"Qe")
907 auto motionWENP = skySafariClient->getMotionWE();
911 skySafariClient->setMotionWE();
916void SkySafari::sendGeographicCoords()
918 auto geographicCoords = skySafariClient->getGeographiCoords();
919 if (geographicCoords && haveLatitude && haveLongitude)
921 auto latitude = geographicCoords->findWidgetByName(
"LAT");
922 auto longitude = geographicCoords->findWidgetByName(
"LONG");
923 if (latitude && longitude)
925 latitude->setValue(siteLatitude);
926 longitude->setValue(siteLongitude);
927 skySafariClient->sendGeographicCoords();
930 haveLatitude = haveLongitude =
false;
935bool SkySafari::sendSkySafari(
const char *message)
939 int bytesWritten = 0, totalBytes = strlen(message);
941 while (bytesWritten < totalBytes)
943 int bytesSent = write(clientFD, message, totalBytes - bytesWritten);
945 bytesWritten += bytesSent;
956void SkySafari::sendUTCtimedate()
958 auto timeUTC = skySafariClient->getTimeUTC();
959 if (timeUTC && haveUTCoffset && haveUTCtime && haveUTCdate)
966 ln_zonedate zonedate;
968 zonedate.years = yyyy;
969 zonedate.months = timeMonth;
970 zonedate.days = timeDay;
971 zonedate.hours = timeHour;
972 zonedate.minutes = timeMin;
973 zonedate.seconds = timeSec;
974 zonedate.gmtoff = timeUTCOffset * 3600.0;
976 ln_zonedate_to_date(&zonedate, &utcdate);
978 char bufDT[32] = {0};
979 char bufOff[8] = {0};
981 snprintf(bufDT, 32,
"%04d-%02d-%02dT%02d:%02d:%02d", utcdate.years, utcdate.months, utcdate.days, utcdate.hours,
982 utcdate.minutes, (
int)(utcdate.seconds));
983 snprintf(bufOff, 8,
"%4.2f", timeUTCOffset);
985 timeUTC->findWidgetByName(
"UTC")->setText(bufDT);
986 timeUTC->findWidgetByName(
"OFFSET")->setText(bufOff);
988 LOGF_DEBUG(
"send to timedate. %s, %s", bufDT, bufOff);
990 skySafariClient->setTimeUTC();
993 haveUTCoffset = haveUTCtime = haveUTCdate =
false;
998std::vector<std::string> SkySafari::split(
const std::string &text,
char sep)
1000 std::vector<std::string> tokens;
1001 std::size_t start = 0,
end = 0;
1002 while ((end = text.find(sep, start)) != std::string::npos)
1004 tokens.push_back(text.substr(start, end - start));
1007 tokens.push_back(text.substr(start));
const char * getDeviceName() const
void setDefaultPollingPeriod(uint32_t msec)
setDefaultPollingPeriod Change the default polling period to call TimerHit() function in the driver.
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 loadConfig(bool silent=false, const char *property=nullptr)
Load the last saved configuration file.
void defineProperty(INumberVectorProperty *property)
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.
int SetTimer(uint32_t ms)
Set a timer to call the function TimerHit after ms milliseconds.
void addDebugControl()
Add Debug control to the driver.
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process the client newSwitch command.
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
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...
virtual bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
virtual 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.
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.
virtual bool Disconnect() override
Disconnect from device.
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
const char * OPTIONS_TAB
OPTIONS_TAB Where all the driver's options are located. Those may include auxiliary controls,...
int f_scansexa(const char *str0, double *dp)
convert sexagesimal string str AxBxC to double. x can be anything non-numeric. Any missing A,...
void getSexComponents(double value, int *d, int *m, int *s)
Implementations for common driver routines.
void IUSaveConfigSwitch(FILE *fp, const ISwitchVectorProperty *svp)
Add a switch vector property value to the configuration file.
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.
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.
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.
void IUSaveConfigText(FILE *fp, const ITextVectorProperty *tvp)
Add a text vector property value to the configuration file.
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.
const char * IUFindOnSwitchName(ISState *states, char *names[], int n)
Returns the name of the first ON switch it finds in the supplied arguments.
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,...)
int IUUpdateText(ITextVectorProperty *tvp, char *texts[], char *names[], int n)
Update all text members in a text vector property.
void IDSetText(const ITextVectorProperty *tvp, const char *fmt,...)
*brief user defined string literal for JSON values *sa std::size_t n
#define LOGF_INFO(fmt,...)
#define LOGF_WARN(fmt,...)
#define LOGF_DEBUG(fmt,...)
#define LOG_ERROR(txt)
Shorter logging macros. In order to use these macros, the function (or method) "getDeviceName()" must...
#define LOGF_ERROR(fmt,...)
*brief create JSON pointer *sa reference_tokens end()
*brief remove last reference token *sa JSON pointer has no nullptr