23#define ASTROLINK4_LEN 100
24#define ASTROLINK4_TIMEOUT 3
29static std::unique_ptr<IndiAstrolink4> indiAstrolink4(
new IndiAstrolink4());
36 setVersion(ASTROLINK4_VERSION_MAJOR, ASTROLINK4_VERSION_MINOR);
47bool IndiAstrolink4::Handshake()
54 if(strncmp(res,
"#:AstroLink4mini", 15) != 0)
101 IUFillNumber(&FocuserSettingsN[FS_SPEED],
"FS_SPEED",
"Speed [pps]",
"%.0f", 0, 4000, 50, 250);
102 IUFillNumber(&FocuserSettingsN[FS_STEP_SIZE],
"FS_STEP_SIZE",
"Step size [um]",
"%.2f", 0, 100, 0.1, 5.0);
103 IUFillNumber(&FocuserSettingsN[FS_COMPENSATION],
"FS_COMPENSATION",
"Compensation [steps/C]",
"%.2f", -1000, 1000, 1, 0);
104 IUFillNumber(&FocuserSettingsN[FS_COMP_THRESHOLD],
"FS_COMP_THRESHOLD",
"Compensation threshold [steps]",
"%.0f", 1, 1000,
126 IUFillNumber(&OtherSettingsN[SET_AREF_COEFF],
"SET_AREF_COEFF",
"V ref coefficient",
"%.3f", 0.9, 1.2, 0.001, 1.09);
127 IUFillNumber(&OtherSettingsN[SET_OVER_TIME],
"SET_OVER_TIME",
"Protection sensitivity [ms]",
"%.0f", 10, 500, 10, 100);
128 IUFillNumber(&OtherSettingsN[SET_OVER_VOLT],
"SET_OVER_VOLT",
"Protection voltage [V]",
"%.1f", 10, 14, 0.1, 14);
129 IUFillNumber(&OtherSettingsN[SET_OVER_AMP],
"SET_OVER_AMP",
"Protection current [A]",
"%.1f", 1, 10, 0.1, 10);
134 IUFillSwitchVector(&BuzzerSP, BuzzerS, 1,
getDeviceName(),
"BUZZER",
"ONOFF", SETTINGS_TAB,
IP_RW,
ISR_NOFMANY, 60,
138 IUFillNumber(&CompensationValueN[0],
"COMP_VALUE",
"Compensation steps",
"%.0f", -10000, 10000, 1, 0);
146 IUFillNumber(&FocusPosMMN[0],
"FOC_POS_MM",
"Position [mm]",
"%.3f", 0.0, 200.0, 0.001, 0.0);
151 IUFillText(&PowerControlsLabelsT[0],
"POWER_LABEL_1",
"Port 1",
"Port 1");
152 IUFillText(&PowerControlsLabelsT[1],
"POWER_LABEL_2",
"Port 2",
"Port 2");
153 IUFillText(&PowerControlsLabelsT[2],
"POWER_LABEL_3",
"Port 3",
"Port 3");
193 IUFillNumber(&PWMN[0],
"PWM1_VAL",
"A",
"%3.0f", 0, 100, 10, 0);
194 IUFillNumber(&PWMN[1],
"PWM2_VAL",
"B",
"%3.0f", 0, 100, 10, 0);
212 IUFillSwitchVector(&AutoPWMSP, AutoPWMS, 2,
getDeviceName(),
"AUTO_PWM",
"Auto PWM", POWER_TAB,
IP_RW,
ISR_NOFMANY, 60,
215 IUFillNumber(&PowerDataN[POW_VIN],
"VIN",
"Input voltage",
"%.1f", 0, 15, 10, 0);
216 IUFillNumber(&PowerDataN[POW_VREG],
"VREG",
"Regulated voltage",
"%.1f", 0, 15, 10, 0);
217 IUFillNumber(&PowerDataN[POW_ITOT],
"ITOT",
"Total current",
"%.1f", 0, 15, 10, 0);
218 IUFillNumber(&PowerDataN[POW_AH],
"AH",
"Energy consumed [Ah]",
"%.1f", 0, 1000, 10, 0);
219 IUFillNumber(&PowerDataN[POW_WH],
"WH",
"Energy consumed [Wh]",
"%.1f", 0, 10000, 10, 0);
224 addParameter(
"WEATHER_TEMPERATURE",
"Temperature (C)", -15, 35, 15);
225 addParameter(
"WEATHER_HUMIDITY",
"Humidity %", 0, 100, 15);
226 addParameter(
"WEATHER_DEWPOINT",
"Dew Point (C)", 0, 100, 15);
229 IUFillNumber(&Sensor2N[0],
"TEMP_2",
"Temperature (C)",
"%.1f", -50, 100, 1, 0);
233 IUFillNumber(&DCFocTimeN[DC_PERIOD],
"DC_PERIOD",
"Time [ms]",
"%.0f", 10, 5000, 10, 500);
234 IUFillNumber(&DCFocTimeN[DC_PWM],
"DC_PWM",
"PWM [%]",
"%.0f", 10, 100, 10, 50);
331 if (!strcmp(name, PWMNP.
name))
334 if(PWMN[0].value != values[0])
338 sprintf(
cmd,
"B:0:%d",
static_cast<uint8_t
>(values[0]));
343 LOG_WARN(
"Cannot set PWM output, it is in AUTO mode.");
346 if(PWMN[1].value != values[1])
350 sprintf(
cmd,
"B:1:%d",
static_cast<uint8_t
>(values[1]));
355 LOG_WARN(
"Cannot set PWM output, it is in AUTO mode.");
367 if(!strcmp(name, FocuserSettingsNP .name))
370 std::map<int, std::string> updates;
371 updates[
U_SPEED] = doubleToStr(values[FS_SPEED]);
372 updates[
U_ACC] = doubleToStr(values[FS_SPEED] * 2.0);
373 updates[
U_STEPSIZE] = doubleToStr(values[FS_STEP_SIZE] * 100.0);
374 allOk = allOk && updateSettings(
"u",
"U", updates);
377 updates[
E_COMP_STEPS] = doubleToStr(values[FS_COMPENSATION] * 100.0);
379 updates[
E_COMP_TRGR] = doubleToStr(values[FS_COMP_THRESHOLD]);
380 allOk = allOk && updateSettings(
"e",
"E", updates);
386 LOG_INFO(values[FS_COMPENSATION] > 0 ?
"Temperature compensation is enabled." :
"Temperature compensation is disabled.");
394 if(!strcmp(name, OtherSettingsNP .name))
396 std::map<int, std::string> updates;
397 updates[
N_AREF_COEFF] = doubleToStr(values[SET_AREF_COEFF] * 1000.0);
398 updates[
N_OVER_VOLT] = doubleToStr(values[SET_OVER_VOLT] * 10.0);
399 updates[
N_OVER_AMP] = doubleToStr(values[SET_OVER_AMP] * 10.0);
400 updates[
N_OVER_TIME] = doubleToStr(values[SET_OVER_TIME]);
401 if(updateSettings(
"n",
"N", updates))
413 if(!strcmp(name, DCFocTimeNP.
name))
418 sprintf(
cmd,
"G:%d:%.0f:%.0f", (DCFocDirS[0].s ==
ISS_ON) ? 1 : 0, DCFocTimeN[DC_PWM].value, DCFocTimeN[DC_PERIOD].value);
432 if (strstr(name,
"FOCUS_"))
434 if (strstr(name,
"WEATHER_"))
450 if (!strcmp(name, Power1SP.
name))
452 sprintf(
cmd,
"C:0:%s", (strcmp(Power1S[0].name, names[0])) ?
"0" :
"1");
463 if (!strcmp(name, Power2SP.
name))
465 sprintf(
cmd,
"C:1:%s", (strcmp(Power2S[0].name, names[0])) ?
"0" :
"1");
476 if (!strcmp(name, Power3SP.
name))
478 sprintf(
cmd,
"C:2:%s", (strcmp(Power3S[0].name, names[0])) ?
"0" :
"1");
489 if(!strcmp(name, CompensateNowSP.
name))
491 sprintf(
cmd,
"S:%d",
static_cast<uint8_t
>(CompensationValueN[0].value));
502 if (!strcmp(name, AutoPWMSP.
name))
511 if (!strcmp(name, DCFocDirSP.
name))
519 if (!strcmp(name, DCFocAbortSP.
name))
521 sprintf(
cmd,
"%s",
"K");
533 if(!strcmp(name, PowerDefaultOnSP.
name))
535 std::map<int, std::string> updates;
539 if(updateSettings(
"u",
"U", updates))
551 if (!strcmp(name, AutoPWMDefaultOnSP.
name))
561 if(!strcmp(name, BuzzerSP.
name))
563 if(updateSettings(
"j",
"J", 1, (states[0] ==
ISS_ON) ?
"1" :
"0"))
575 if(!strcmp(name, FocuserManualSP.
name))
577 sprintf(
cmd,
"F:%s", (strcmp(FocuserManualS[0].name, names[0])) ?
"0" :
"1");
590 if(!strcmp(name, FocuserModeSP.
name))
592 std::string value =
"0";
593 if(!strcmp(FocuserModeS[FS_MODE_UNI].name, names[0])) value =
"0";
594 if(!strcmp(FocuserModeS[FS_MODE_BI].name, names[0])) value =
"1";
595 if(!strcmp(FocuserModeS[FS_MODE_MICRO].name, names[0])) value =
"2";
608 if(!strcmp(name, FocuserCompModeSP.
name))
610 std::string value =
"0";
611 if(!strcmp(FocuserCompModeS[FS_COMP_AUTO].name, names[0])) value =
"1";
612 if(updateSettings(
"e",
"E",
E_COMP_AUTO, value.c_str()))
623 if (strstr(name,
"FOCUS"))
636 if (!strcmp(name, PowerControlsLabelsTP.
name))
639 PowerControlsLabelsTP.
s =
IPS_OK;
640 LOG_INFO(
"Power port labels saved. Driver must be restarted for the labels to take effect.");
642 IDSetText(&PowerControlsLabelsTP,
nullptr);
665bool IndiAstrolink4::setAutoPWM()
670 uint8_t valA = (AutoPWMS[0].s ==
ISS_ON) ? 255 : static_cast<uint8_t>(PWMN[0].value);
671 uint8_t valB = (AutoPWMS[1].s ==
ISS_ON) ? 255 : static_cast<uint8_t>(PWMN[1].value);
686 int32_t backlash = 0;
689 if((targetTicks >
FocusAbsPosNP[0].getValue()) == (backlashSteps > 0))
691 if(((int32_t)targetTicks + backlash) < 0 || (targetTicks + backlash) >
FocusMaxPosNP[0].getValue())
697 backlash = backlashSteps;
698 requireBacklashReturn =
true;
720 return updateSettings(
"u",
"U",
U_REVERSED, (enabled) ?
"1" :
"0");
732 if(updateSettings(
"u",
"U",
U_MAX_POS, std::to_string(ticks).c_str()))
745 backlashSteps = steps;
751 backlashEnabled = enabled;
760 int nbytes_read = 0, nbytes_written = 0, tty_rc = 0;
765 if(strcmp(
cmd,
"#") == 0) sprintf(res,
"%s\n",
"#:AstroLink4mini");
766 if(strcmp(
cmd,
"q") == 0) sprintf(res,
"%s\n",
767 "q:1234:0:1.47:1:2.12:45.1:-12.81:1:-25.22:45:0:0:0:1:12.1:5.0:1.12:13.41:0:34:0:0");
768 if(strcmp(
cmd,
"p") == 0) sprintf(res,
"%s\n",
"p:1234");
769 if(strcmp(
cmd,
"i") == 0) sprintf(res,
"%s\n",
"i:0");
770 if(strcmp(
cmd,
"n") == 0) sprintf(res,
"%s\n",
"n:1077:14.0:10.0:100");
771 if(strcmp(
cmd,
"e") == 0) sprintf(res,
"%s\n",
"e:30:1200:1:0:20");
772 if(strcmp(
cmd,
"u") == 0) sprintf(res,
"%s\n",
"u:25000:220:0:100:440:0:0:1:257:0:0:0:0:0:1:0:0");
773 if(strncmp(
cmd,
"R", 1) == 0) sprintf(res,
"%s\n",
"R:");
774 if(strncmp(
cmd,
"C", 1) == 0) sprintf(res,
"%s\n",
"C:");
775 if(strncmp(
cmd,
"B", 1) == 0) sprintf(res,
"%s\n",
"B:");
776 if(strncmp(
cmd,
"H", 1) == 0) sprintf(res,
"%s\n",
"H:");
777 if(strncmp(
cmd,
"P", 1) == 0) sprintf(res,
"%s\n",
"P:");
778 if(strncmp(
cmd,
"U", 1) == 0) sprintf(res,
"%s\n",
"U:");
779 if(strncmp(
cmd,
"S", 1) == 0) sprintf(res,
"%s\n",
"S:");
780 if(strncmp(
cmd,
"G", 1) == 0) sprintf(res,
"%s\n",
"G:");
781 if(strncmp(
cmd,
"K", 1) == 0) sprintf(res,
"%s\n",
"K:");
782 if(strncmp(
cmd,
"N", 1) == 0) sprintf(res,
"%s\n",
"N:");
783 if(strncmp(
cmd,
"E", 1) == 0) sprintf(res,
"%s\n",
"E:");
787 tcflush(PortFD, TCIOFLUSH);
788 sprintf(command,
"%s\n",
cmd);
795 tcflush(PortFD, TCIOFLUSH);
803 tcflush(PortFD, TCIOFLUSH);
804 res[nbytes_read - 1] =
'\0';
815 return (
cmd[0] == res[0]);
821bool IndiAstrolink4::sensorRead()
826 std::vector<std::string> result = split(res,
":");
830 FocusPosMMNP[0].setValue(focuserPosition * FocuserSettingsN[FS_STEP_SIZE].value / 1000.0);
834 if(requireBacklashReturn)
836 requireBacklashReturn =
false;
852 PowerDataN[POW_ITOT].value = std::stod(result[
Q_CURRENT]);
854 if(result.size() > 5)
880 PWMN[0].value = std::stod(result[
Q_PWM1]);
881 PWMN[1].value = std::stod(result[
Q_PWM2]);
885 bool dcMotorMoving = (std::stod(result[
Q_DC_MOVE]) > 0);
915 CompensationValueN[0].value = std::stod(result[
Q_COMP_DIFF]);
916 CompensateNowSP.
s = CompensationValueNP.
s = (CompensationValueN[0].value > 0) ?
IPS_OK :
IPS_IDLE;
917 CompensateNowS[0].s = (CompensationValueN[0].value > 0) ?
ISS_OFF :
ISS_ON;
921 PowerDataN[POW_VIN].value = std::stod(result[
Q_VIN]);
922 PowerDataN[POW_VREG].value = std::stod(result[
Q_VREG]);
923 PowerDataN[POW_AH].value = std::stod(result[
Q_AH]);
924 PowerDataN[POW_WH].value = std::stod(result[
Q_WH]);
926 if(strcmp(result[
Q_OP_FLAG].c_str(),
"0"))
928 int opFlag = std::stoi(result[
Q_OP_FLAG]);
929 LOGF_WARN(
"Protection triggered, outputs were disabled. Reason: %s was too high, value: %.1f",
930 (opFlag == 1) ?
"voltage" :
"current",
std::stod(result[
Q_OP_VALUE]));
941 || FocuserCompModeSP.
s !=
IPS_OK)
945 std::vector<std::string> result = split(res,
":");
947 FocuserModeS[FS_MODE_UNI].s = FocuserModeS[FS_MODE_BI].s = FocuserModeS[FS_MODE_MICRO].s =
ISS_OFF;
960 FocuserSettingsN[FS_SPEED].value = std::stod(result[
U_SPEED]);
961 FocuserSettingsN[FS_STEP_SIZE].value = std::stod(result[
U_STEPSIZE]) / 100.0;
970 std::vector<std::string> result = split(res,
":");
971 BuzzerS[0].s = (std::stod(result[1]) > 0) ?
ISS_ON :
ISS_OFF;
978 std::vector<std::string> result = split(res,
":");
979 FocuserSettingsN[FS_COMPENSATION].value = std::stod(result[
E_COMP_STEPS]) / 100.0;
980 FocuserSettingsN[FS_COMP_THRESHOLD].value = std::stod(result[
E_COMP_TRGR]);
991 if(FocuserManualSP.
s !=
IPS_OK)
995 std::vector<std::string> result = split(res,
":");
996 FocuserManualS[FS_MANUAL_OFF].s = (std::stod(result[1]) == 0) ?
ISS_ON :
ISS_OFF;
997 FocuserManualS[FS_MANUAL_ON].s = (std::stod(result[1]) > 0) ?
ISS_ON :
ISS_OFF;
1003 if(OtherSettingsNP.
s !=
IPS_OK)
1007 std::vector<std::string> result = split(res,
":");
1008 OtherSettingsN[SET_AREF_COEFF].value = std::stod(result[
N_AREF_COEFF]) / 1000.0;
1009 OtherSettingsN[SET_OVER_TIME].value = std::stod(result[
N_OVER_TIME]);
1010 OtherSettingsN[SET_OVER_VOLT].value = std::stod(result[
N_OVER_VOLT]) / 10.0;
1011 OtherSettingsN[SET_OVER_AMP].value = std::stod(result[
N_OVER_AMP]) / 10.0;
1023std::vector<std::string> IndiAstrolink4::split(
const std::string &input,
const std::string ®ex)
1026 std::regex re(regex);
1027 std::sregex_token_iterator
1028 first{input.begin(), input.end(), re, -1},
1030 return {first, last};
1033std::string IndiAstrolink4::doubleToStr(
double val)
1036 sprintf(buf,
"%.0f", val);
1037 return std::string(buf);
1040bool IndiAstrolink4::updateSettings(
const char * getCom,
const char * setCom,
int index,
const char * value)
1042 std::map<int, std::string> values;
1043 values[index] = value;
1044 return updateSettings(getCom, setCom, values);
1047bool IndiAstrolink4::updateSettings(
const char * getCom,
const char * setCom, std::map<int, std::string> values)
1053 std::string concatSettings =
"";
1054 std::vector<std::string> result = split(res,
":");
1055 if(result.size() >= values.size())
1058 for(std::map<int, std::string>::iterator it = values.begin(); it != values.end(); ++it)
1059 result[it->first] = it->second;
1061 for (
const auto &piece : result) concatSettings += piece +
":";
void registerHandshake(std::function< bool()> callback)
registerHandshake Register a handshake function to be called once the initial connection to the devic...
The Serial class manages connection with serial devices including Bluetooth. Serial communication is ...
void setDefaultBaudRate(BaudRate newRate)
setDefaultBaudRate Set default baud rate. The default baud rate is 9600 unless otherwise changed by t...
void setDefaultPort(const char *port)
setDefaultPort Set default port. Call this function in initProperties() of your driver if you want to...
const char * getDeviceName() const
virtual bool updateProperties()
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool saveConfig(bool silent=false, const char *property=nullptr)
Save the current properties in a configuration file.
void addConfigurationControl()
Add Configuration control to the driver.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process the client newSwitch command.
void addSimulationControl()
Add Simulation control to the driver.
void registerConnection(Connection::Interface *newConnection)
registerConnection Add new connection plugin to the existing connection pool. The connection type sha...
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.
bool isSimulation() const
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.
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.
Provides interface to implement focuser functionality.
INDI::PropertyNumber FocusRelPosNP
bool updateProperties()
updateProperties Define or Delete Rotator properties based on the connection status of the base devic...
void SetCapability(uint32_t cap)
FI::SetCapability sets the focuser capabilities. All capabilities must be initialized.
void initProperties(const char *groupName)
Initialize focuser properties. It is recommended to call this function within initProperties() of you...
INDI::PropertyNumber FocusMaxPosNP
bool saveConfigItems(FILE *fp)
saveConfigItems save focuser properties defined in the interface in config file
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process focus number properties.
bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process focus switch properties.
INDI::PropertyNumber FocusAbsPosNP
void setState(IPState state)
void apply(const char *format,...) const ATTRIBUTE_FORMAT_PRINTF(2
Provides interface to implement weather reporting and safety monitoring functionality.
void addParameter(std::string name, std::string label, double numMinOk, double numMaxOk, double percWarning, bool flipWarning=false)
Add a physical weather measurable parameter to the weather driver.
void setParameterValue(std::string name, double value)
setParameterValue Update weather parameter value
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process weather number properties.
INDI::PropertyNumber ParametersNP
void initProperties(const char *statusGroup, const char *paramsGroup)
Initialize focuser properties. It is recommended to call this function within initProperties() of you...
bool updateProperties()
updateProperties Define or Delete Rotator properties based on the connection status of the base devic...
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual bool SetFocuserMaxPosition(uint32_t ticks) override
SetFocuserMaxPosition Set Focuser Maximum position limit in the hardware.
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
virtual bool SyncFocuser(uint32_t ticks) override
SyncFocuser Set current position to ticks without moving the focuser.
virtual bool SetFocuserBacklash(int32_t steps) override
SetFocuserBacklash Set the focuser backlash compensation value.
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
Focuser interface.
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool sendCommand(const char *cmd, char *res)
Serial commands.
virtual bool initProperties() override
Overrides.
virtual bool SetFocuserBacklashEnabled(bool enabled) override
SetFocuserBacklashEnabled Enables or disables the focuser backlash compensation.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
IndiAstrolink4()
Constructor.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
virtual const char * getDefaultName() override
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool ReverseFocuser(bool enabled) override
ReverseFocuser Reverse focuser motion direction.
const char * FOCUS_TAB
FOCUS_TAB Where all the properties for focuser are located.
#define ASTROLINK4_TIMEOUT
int tty_write_string(int fd, const char *buf, int *nbytes_written)
Writes a null terminated string to fd.
void tty_error_msg(int err_code, char *err_msg, int err_msg_len)
Retrieve the tty error message.
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
Implementations for common driver routines.
void IUSaveConfigSwitch(FILE *fp, const ISwitchVectorProperty *svp)
Add a switch vector property value to the configuration file.
void IUFillNumberVector(INumberVectorProperty *nvp, INumber *np, int nnp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a number vector property. The vector's auxiliary elements will be set to NULL.
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 IUSaveConfigNumber(FILE *fp, const INumberVectorProperty *nvp)
Add a number vector property value to the configuration file.
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 IUFillNumber(INumber *np, const char *name, const char *label, const char *format, double min, double max, double step, double value)
Assign attributes for a number property. The number'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.
int IUUpdateSwitch(ISwitchVectorProperty *svp, ISState *states, char *names[], int n)
Update all switches in a switch vector property.
void IDSetNumber(const INumberVectorProperty *nvp, const char *fmt,...)
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.
int IUGetConfigText(const char *dev, const char *property, const char *member, char *value, int len)
IUGetConfigText Opens configuration file and reads single text property.
int IUUpdateNumber(INumberVectorProperty *nvp, double values[], char *names[], int n)
Update all numbers in a number vector property.
void IDSetText(const ITextVectorProperty *tvp, const char *fmt,...)
int IUGetConfigSwitch(const char *dev, const char *property, const char *member, ISState *value)
IUGetConfigSwitch Opens configuration file and reads single switch property.
#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,...)