Instrument Neutral Distributed Interface INDI  1.9.5
activefocuser.cpp
Go to the documentation of this file.
1 /*
2  ActiveFocuser driver for Takahashi CCA-250 and Mewlon-250/300CRS
3 
4  Driver written by Alvin FREY <https://afrey.fr> for Optique Unterlinden and Takahashi Europe
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 
20 */
21 
22 
23 #include "activefocuser.h"
24 #include "activefocuser_utils.h"
25 
26 static std::unique_ptr<ActiveFocuser> activeFocuser(new ActiveFocuser());
27 
28 #define DRIVER_NAME "ActiveFocuser"
29 #define DRIVER_VERSION_MAJOR 1
30 #define DRIVER_VERSION_MINOR 0
31 
32 #define VENDOR_ID 0x20E1
33 #define PRODUCT_ID 0x0002
34 
35 int MAX_TICKS = 192307;
36 
38 
39  hid_handle = nullptr;
42 
43 }
44 
46 
47  if (hid_handle) {
48 
50  if(poller->IsRunning){
51  poller->Stop() ;
52  }
53 
54  hid_close(hid_handle);
55 
56  }
57 
58  hid_exit();
59 
60 }
61 
63 
64  if (!hid_handle) {
65 
66  hid_handle = hid_open(VENDOR_ID, PRODUCT_ID, nullptr);
67 
68  if (hid_handle) {
69 
70  hid_set_nonblocking(hid_handle, 1);
71 
73  if (!poller->IsRunning) {
74  poller->Start();
75  }
76 
77  return true;
78 
79  } else {
80 
81  return false;
82 
83  }
84 
85  }
86 
87  return hid_handle != nullptr;
88 
89 }
90 
92 
93  if (hid_handle) {
94 
96  if (poller->IsRunning) {
97  poller->Stop();
98  }
99 
100  hid_close(hid_handle);
101 
102  }
103 
104  hid_handle = nullptr;
105 
106  return true;
107 
108 
109 }
110 
112 
113  return DRIVER_NAME;
114 
115 }
116 
117 void ActiveFocuser::ISGetProperties(const char *dev) {
118 
119  if (dev != nullptr && strcmp(dev, getDeviceName()) != 0)
120  return;
121 
123 
124 }
125 
127 
129 
131 
132  // Adding version display
133 
134  IUFillText(&HardwareVersionN[0], "Version infos", "", "1.04");
135  IUFillTextVector(&HardwareVersionNP, HardwareVersionN, 1, getDeviceName(), "HARDWARE_VERSION", "Hardware Version",
137 
138  std::stringstream softwareVersionStream;
139  softwareVersionStream << DRIVER_VERSION_MAJOR << "." << DRIVER_VERSION_MINOR;
140 
141  IUFillText(&SoftwareVersionN[0], "Version infos", "", softwareVersionStream.str().c_str());
142  IUFillTextVector(&SoftwareVersionNP, SoftwareVersionN, 1, getDeviceName(), "SOFTWARE_VERSION", "Software Version",
144 
145  // Adding temperature sensor display
146 
147  IUFillNumber(&AirTemperatureN[0], "AIR TEMPERATURE", "Celsius", "%6.2f", -50., 70., 0., 0.);
148  IUFillNumberVector(&AirTemperatureNP, AirTemperatureN, 1, getDeviceName(), "AIR_TEMPERATURE", "Air Temperature",
150 
151  IUFillNumber(&TubeTemperatureN[0], "TUBE TEMPERATURE", "Celsius", "%6.2f", -50., 70., 0., 0.);
152  IUFillNumberVector(&TubeTemperatureNP, TubeTemperatureN, 1, getDeviceName(), "TUBE_TEMPERATURE", "Tube Temperature",
154 
155  IUFillNumber(&MirrorTemperatureN[0], "MIRROR TEMPERATURE", "Celsius", "%6.2f", -50., 70., 0., 0.);
156  IUFillNumberVector(&MirrorTemperatureNP, MirrorTemperatureN, 1, getDeviceName(), "MIRROR_TEMPERATURE",
157  "Mirror Temperature",
159 
160  // Adding FAN control button
161 
162  IUFillSwitch(&FanS[0], "FAN_ON", "On", ISS_ON);
163  IUFillSwitch(&FanS[1], "FAN_OFF", "Off", ISS_OFF);
164  IUFillSwitchVector(&FanSP, FanS, 2, getDeviceName(), "FAN_STATE", "Fan", MAIN_CONTROL_TAB, IP_RW, ISR_1OFMANY, 60,
165  IPS_IDLE);
166 
167  // Setting focus max position constant
168 
169  FocusMaxPosN[0].value = MAX_TICKS;
171  strncpy(FocusMaxPosN[0].label, "Steps", MAXINDILABEL);
172 
173  // Disabling focuser speed
174 
175  FocusSpeedN[0].min = 0;
176  FocusSpeedN[0].max = 0;
177  FocusSpeedN[0].value = 1;
179 
180  // Setting default absolute position values
181 
182  FocusAbsPosN[0].min = 0.;
183  FocusAbsPosN[0].max = MAX_TICKS;
184  FocusAbsPosN[0].value = 0;
185  FocusAbsPosN[0].step = 1000.;
186  strncpy(FocusAbsPosN[0].label, "Steps", MAXINDILABEL);
187 
188 
189  // Setting default relative position values
190 
191  FocusRelPosN[0].min = 0.;
192  FocusRelPosN[0].max = 5000;
193  FocusRelPosN[0].value = 100;
194  FocusRelPosN[0].step = 1;
195  strncpy(FocusRelPosN[0].label, "Steps", MAXINDILABEL);
196 
197  PresetN[0].max = MAX_TICKS;
198  PresetN[1].max = MAX_TICKS;
199  PresetN[2].max = MAX_TICKS;
200 
201  internalTicks = FocusAbsPosN[0].value;
202 
204 
206 
207  return true;
208 
209 }
210 
212 
214 
215  if (hid_handle) {
216 
217  defineProperty(&HardwareVersionNP);
218  defineProperty(&SoftwareVersionNP);
219  defineProperty(&AirTemperatureNP);
220  defineProperty(&TubeTemperatureNP);
221  defineProperty(&MirrorTemperatureNP);
222  defineProperty(&FanSP);
223 
224  } else {
225 
226  deleteProperty(HardwareVersionNP.name);
227  deleteProperty(SoftwareVersionNP.name);
228  deleteProperty(AirTemperatureNP.name);
229  deleteProperty(TubeTemperatureNP.name);
230  deleteProperty(MirrorTemperatureNP.name);
231  deleteProperty(FanSP.name);
232 
233  }
234 
235  return true;
236 
237 }
238 
239 bool ActiveFocuser::ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) {
240 
241  if (dev != nullptr && strcmp(dev, getDeviceName()) == 0) {
242 
243  if (strcmp(FanSP.name, name) == 0) {
244 
245  IUUpdateSwitch(&FanSP, states, names, n);
246 
247  if (FanS[0].s == ISS_ON && !ActiveFocuserUtils::SystemState::GetIsFanOn()) {
248 
249  if (hid_handle) {
250 
251  const unsigned char data[3] = {0x01,
253  hid_write(hid_handle, data, sizeof(data));
254 
255  }else{
256 
257  IDLog("Connection failed");
258 
259  }
260 
261  } else if (FanS[0].s == ISS_OFF && ActiveFocuserUtils::SystemState::GetIsFanOn()) {
262 
263  if (hid_handle) {
264 
265  const unsigned char data[3] = {0x01,
267  hid_write(hid_handle, data, sizeof(data));
268 
269  }else{
270 
271  IDLog("Connection failed");
272 
273  }
274 
275  }
276 
277  FanSP.s = IPS_OK;
278  IDSetSwitch(&FanSP, nullptr);
279 
280  return true;
281 
282  }
283 
284 
285  }
286 
287  return INDI::Focuser::ISNewSwitch(dev, name, states, names, n);
288 
289 }
290 
291 bool ActiveFocuser::ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) {
292 
293  if(dev != nullptr && strcmp(dev, getDeviceName()) == 0){
294  }
295 
296  return INDI::Focuser::ISNewNumber(dev, name, values, names, n);
297 
298 }
299 
301 
302  if (hid_handle) {
303 
305 
306  const unsigned char data[3] = {0x01, ActiveFocuserUtils::CommandsMap.at(ActiveFocuserUtils::STOP)}; // STOP
307  hid_write(hid_handle, data, sizeof(data));
308 
309  return true;
310 
311  }else{
312 
313  return false;
314 
315  }
316 
317  } else {
318 
319  IDLog("Connection failed");
320 
321  return false;
322 
323  }
324 
325 }
326 
327 IPState ActiveFocuser::MoveAbsFocuser(uint32_t targetTicks) {
328 
329  internalTicks = targetTicks;
330 
331  if (targetTicks > (uint32_t)MAX_TICKS) {
332 
333  return IPS_ALERT;
334 
335  } else {
336 
338 
339  if(hid_handle){
340 
341  unsigned char data[8] = {0x00, 0x05, ActiveFocuserUtils::CommandsMap.at(ActiveFocuserUtils::MOVE), 0x00, 0x00, 0x00, 0x00, 0x00};
342 
343  for (int i = 0; i < 4; ++i) {
344  auto num = (targetTicks >> 8 * (3-i) & 255);
345  data[3+i] = num;
346  }
347 
348  hid_write(hid_handle, data, sizeof(data));
349 
350  return IPS_OK;
351 
352  }else{
353 
354  return IPS_ALERT;
355 
356  }
357 
358  }else{
359 
360  return IPS_BUSY;
361 
362  }
363 
364  }
365 
366 }
367 
369 
370  FocusRelPosN[0].value = ticks;
371  IDSetNumber(&FocusRelPosNP, nullptr);
372 
373  int relativeTicks = ((dir == FOCUS_INWARD ? ticks : -ticks));
374 
375  double newTicks = internalTicks + relativeTicks;
376 
377  return MoveAbsFocuser(newTicks);
378 
379 }
380 
382 
383  if(!hid_handle){
384 
386 
387  }else{
388 
390  FocusMaxPosN[0].value = MAX_TICKS;
391  IDSetNumber(&FocusMaxPosNP, nullptr);
392 
393  PresetN[0].max = MAX_TICKS;
394  PresetN[1].max = MAX_TICKS;
395  PresetN[2].max = MAX_TICKS;
396 
397  HardwareVersionN[0].text = ActiveFocuserUtils::SystemState::GetHardwareRevision();
398  IDSetText(&HardwareVersionNP, nullptr);
399 
401  IDSetNumber(&FocusAbsPosNP, nullptr);
402 
403  internalTicks = FocusAbsPosN[0].value;
404 
405  AirTemperatureN[0].value = ActiveFocuserUtils::SystemState::GetAirTemperature();
406  IDSetNumber(&AirTemperatureNP, nullptr);
407  TubeTemperatureN[0].value = ActiveFocuserUtils::SystemState::GetTubeTemperature();
408  IDSetNumber(&TubeTemperatureNP, nullptr);
409  MirrorTemperatureN[0].value = ActiveFocuserUtils::SystemState::GetMirrorTemperature();
410  IDSetNumber(&MirrorTemperatureNP, nullptr);
411 
413  FanS[0].s = ISS_ON;
414  IDSetSwitch(&FanSP, nullptr);
415  }else{
416  FanS[0].s = ISS_OFF;
417  IDSetSwitch(&FanSP, nullptr);
418  }
419 
423  }else{
426  }
427 
429 
430  }
431 
432 }
ActiveFocuserUtils::SystemState::GetIsMoving
static bool GetIsMoving()
Definition: activefocuser_utils.cpp:229
INDI::FocuserInterface::FOCUSER_CAN_ABS_MOVE
@ FOCUSER_CAN_ABS_MOVE
Definition: indifocuserinterface.h:74
IP_RO
@ IP_RO
Definition: indiapi.h:183
hid_set_nonblocking
int HID_API_EXPORT hid_set_nonblocking(hid_device *dev, int nonblock)
Set the device handle to be non-blocking.
Definition: hid_libusb.c:1100
INDI::FocuserInterface::FOCUSER_CAN_REL_MOVE
@ FOCUSER_CAN_REL_MOVE
Definition: indifocuserinterface.h:75
INDI::FocuserInterface::FocusAbsPosNP
INumberVectorProperty FocusAbsPosNP
Definition: indifocuserinterface.h:282
INDI::FocuserInterface::FocusMaxPosNP
INumberVectorProperty FocusMaxPosNP
Definition: indifocuserinterface.h:290
IUUpdateMinMax
void IUUpdateMinMax(const INumberVectorProperty *nvp)
Function to update the min and max elements of a number in the client.
Definition: indidriver.c:1850
ActiveFocuser::~ActiveFocuser
~ActiveFocuser()
Definition: activefocuser.cpp:45
IPState
IPState
Property state.
Definition: indiapi.h:158
hid_write
int HID_API_EXPORT hid_write(hid_device *dev, const unsigned char *data, size_t length)
Write an Output report to a HID device.
Definition: hid_libusb.c:929
ActiveFocuserUtils::FAN_ON
@ FAN_ON
Definition: activefocuser_utils.h:47
IPS_OK
@ IPS_OK
Definition: indiapi.h:161
activefocuser_utils.h
_INumberVectorProperty::s
IPState s
Definition: indiapi.h:332
PRODUCT_ID
#define PRODUCT_ID
Definition: activefocuser.cpp:33
ActiveFocuser
Definition: activefocuser.h:26
ISS_OFF
@ ISS_OFF
Definition: indiapi.h:150
ActiveFocuserUtils::Poller
Definition: activefocuser_utils.h:70
INDI::Focuser::ISGetProperties
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...
Definition: indifocuser.cpp:111
ActiveFocuser::AbortFocuser
bool AbortFocuser() override
AbortFocuser all focus motion.
Definition: activefocuser.cpp:300
IDSetText
void IDSetText(const ITextVectorProperty *t, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to update an existing text vector property.
ActiveFocuserUtils::SystemState::GetMirrorTemperature
static double GetMirrorTemperature()
Definition: activefocuser_utils.cpp:301
IPS_ALERT
@ IPS_ALERT
Definition: indiapi.h:163
ActiveFocuserUtils::SystemState::GetIsFanOn
static bool GetIsFanOn()
Definition: activefocuser_utils.cpp:237
ActiveFocuser::ISNewNumber
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
Definition: activefocuser.cpp:291
IUFillNumber
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.
Definition: indidriver.c:348
INDI::DefaultDevice::defineProperty
void defineProperty(INumberVectorProperty *property)
Definition: defaultdevice.cpp:997
MAIN_CONTROL_TAB
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
Definition: defaultdevice.cpp:34
hid_exit
int HID_API_EXPORT hid_exit(void)
Finalize the HIDAPI library.
Definition: hid_libusb.c:407
INDI::Focuser::CONNECTION_NONE
@ CONNECTION_NONE
Definition: indifocuser.h:54
IUFillTextVector
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: indidriver.c:477
ActiveFocuserUtils::Poller::GetInstance
static Poller * GetInstance(hid_device &hid_handle)
Definition: activefocuser_utils.cpp:94
INDI::DefaultDevice::setDefaultPollingPeriod
void setDefaultPollingPeriod(uint32_t msec)
setDefaultPollingPeriod Change the default polling period to call TimerHit() function in the driver.
Definition: defaultdevice.cpp:1157
ActiveFocuserUtils::Poller::IsRunning
bool IsRunning
Definition: activefocuser_utils.h:73
INDI::DefaultDevice::setVersion
void setVersion(uint16_t vMajor, uint16_t vMinor)
Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.
Definition: defaultdevice.cpp:1219
INDI::BaseDevice::getDeviceName
const char * getDeviceName() const
Definition: basedevice.cpp:799
INDI::FocuserInterface::FOCUSER_CAN_ABORT
@ FOCUSER_CAN_ABORT
Definition: indifocuserinterface.h:76
IUFillText
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: indidriver.c:369
IDLog
void void void void void IDLog(const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(1
Function Drivers call to log a message locally.
VENDOR_ID
#define VENDOR_ID
Definition: activefocuser.cpp:32
INDI::DefaultDevice::getCurrentPollingPeriod
uint32_t getCurrentPollingPeriod() const
getCurrentPollingPeriod Return the current polling period.
Definition: defaultdevice.cpp:1139
ActiveFocuserUtils::SystemState::GetSpan
static int GetSpan()
Definition: activefocuser_utils.cpp:269
activefocuser.h
ActiveFocuserUtils::SystemState::GetTubeTemperature
static double GetTubeTemperature()
Definition: activefocuser_utils.cpp:293
INDI::DefaultDevice::SetTimer
int SetTimer(uint32_t ms)
Set a timer to call the function TimerHit after ms milliseconds.
Definition: defaultdevice.cpp:865
ActiveFocuserUtils::CommandsMap
static const std::map< Commands, unsigned char > CommandsMap
Definition: activefocuser_utils.h:53
ActiveFocuserUtils::Poller::Stop
bool Stop()
Definition: activefocuser_utils.cpp:171
ActiveFocuser::updateProperties
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition: activefocuser.cpp:211
INDI::FocuserInterface::FOCUS_INWARD
@ FOCUS_INWARD
Definition: indifocuserinterface.h:68
ActiveFocuser::initProperties
bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: activefocuser.cpp:126
INDI::Focuser::PresetN
INumber PresetN[3]
Definition: indifocuser.h:104
IUFillSwitchVector
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: indidriver.c:412
DRIVER_VERSION_MINOR
#define DRIVER_VERSION_MINOR
Definition: activefocuser.cpp:30
IUFillNumberVector
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.
Definition: indidriver.c:455
IPS_BUSY
@ IPS_BUSY
Definition: indiapi.h:162
ISR_1OFMANY
@ ISR_1OFMANY
Definition: indiapi.h:172
IPS_IDLE
@ IPS_IDLE
Definition: indiapi.h:160
ActiveFocuser::ISGetProperties
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
Definition: activefocuser.cpp:117
ActiveFocuserUtils::SystemState::GetCurrentPositionStep
static int GetCurrentPositionStep()
Definition: activefocuser_utils.cpp:205
INDI::FocuserInterface::FocusRelPosN
INumber FocusRelPosN[1]
Definition: indifocuserinterface.h:287
ActiveFocuserUtils::SystemState::GetAirTemperature
static double GetAirTemperature()
Definition: activefocuser_utils.cpp:285
INDI::Focuser::updateProperties
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition: indifocuser.cpp:120
_INumberVectorProperty::name
char name[MAXINDINAME]
Definition: indiapi.h:322
ActiveFocuser::getDefaultName
const char * getDefaultName() override
Definition: activefocuser.cpp:111
IUUpdateSwitch
int IUUpdateSwitch(ISwitchVectorProperty *svp, ISState *states, char *names[], int n)
Update all switches in a switch vector property.
Definition: indidriver.c:171
INDI::FocuserInterface::FocusRelPosNP
INumberVectorProperty FocusRelPosNP
Definition: indifocuserinterface.h:286
_ITextVectorProperty::name
char name[MAXINDINAME]
Definition: indiapi.h:249
ActiveFocuser::ISNewSwitch
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Definition: activefocuser.cpp:239
MAX_TICKS
int MAX_TICKS
Definition: activefocuser.cpp:35
DRIVER_VERSION_MAJOR
#define DRIVER_VERSION_MAJOR
Definition: activefocuser.cpp:29
INDI::FocuserInterface::SetCapability
void SetCapability(uint32_t cap)
FI::SetCapability sets the focuser capabilities. All capabilities must be initialized.
Definition: indifocuserinterface.h:95
ActiveFocuserUtils::SystemState::GetIsHold
static bool GetIsHold()
Definition: activefocuser_utils.cpp:245
ActiveFocuser::Connect
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
Definition: activefocuser.cpp:62
name
const char * name
Definition: indiserver.c:116
_ISwitchVectorProperty::s
IPState s
Definition: indiapi.h:382
INDI::FocuserInterface::FocusMaxPosN
INumber FocusMaxPosN[1]
Definition: indifocuserinterface.h:291
ActiveFocuserUtils::FAN_OFF
@ FAN_OFF
Definition: activefocuser_utils.h:48
_INumberVectorProperty::p
IPerm p
Definition: indiapi.h:328
ActiveFocuser::Disconnect
bool Disconnect() override
Disconnect from device.
Definition: activefocuser.cpp:91
DRIVER_NAME
#define DRIVER_NAME
Definition: activefocuser.cpp:28
INDI::FocuserInterface::FocusDirection
FocusDirection
Definition: indifocuserinterface.h:66
IP_RW
@ IP_RW
Definition: indiapi.h:185
MAXINDILABEL
#define MAXINDILABEL
Definition: indiapi.h:191
ActiveFocuser::MoveAbsFocuser
IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
Definition: activefocuser.cpp:327
INDI::FocuserInterface::FocusSpeedNP
INumberVectorProperty FocusSpeedNP
Definition: indifocuserinterface.h:268
ActiveFocuserUtils::Poller::Start
bool Start()
Definition: activefocuser_utils.cpp:158
ActiveFocuserUtils::SystemState::GetHardwareRevision
static char * GetHardwareRevision()
Definition: activefocuser_utils.cpp:253
ISState
ISState
Switch state.
Definition: indiapi.h:148
INDI::Focuser::setSupportedConnections
void setSupportedConnections(const uint8_t &value)
setConnection Set Focuser connection mode. Child class should call this in the constructor before Foc...
Definition: indifocuser.cpp:373
ActiveFocuserUtils::STOP
@ STOP
Definition: activefocuser_utils.h:46
ActiveFocuser::MoveRelFocuser
IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
Definition: activefocuser.cpp:368
hid_open
hid_device * hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number)
Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number.
Definition: hid_libusb.c:612
ActiveFocuser::TimerHit
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
Definition: activefocuser.cpp:381
INDI::Focuser::initProperties
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: indifocuser.cpp:58
INDI::DefaultDevice::deleteProperty
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
Definition: defaultdevice.cpp:965
INDI::Focuser::ISNewSwitch
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Definition: indifocuser.cpp:168
INDI::FocuserInterface::FocusAbsPosN
INumber FocusAbsPosN[1]
Definition: indifocuserinterface.h:283
hid_close
void HID_API_EXPORT hid_close(hid_device *dev)
Close a HID device.
Definition: hid_libusb.c:1163
IDSetNumber
void void void IDSetNumber(const INumberVectorProperty *n, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to update an existing number vector property.
IDSetSwitch
void void void void void IDSetSwitch(const ISwitchVectorProperty *s, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to update an existing switch vector property.
ActiveFocuserUtils::MOVE
@ MOVE
Definition: activefocuser_utils.h:45
IUFillSwitch
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: indidriver.c:320
INDI::Focuser::ISNewNumber
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
Definition: indifocuser.cpp:145
INDI::FocuserInterface::FocusSpeedN
INumber FocusSpeedN[1]
Definition: indifocuserinterface.h:269
ActiveFocuser::ActiveFocuser
ActiveFocuser()
Definition: activefocuser.cpp:37
_ISwitchVectorProperty::name
char name[MAXINDINAME]
Definition: indiapi.h:370
ISS_ON
@ ISS_ON
Definition: indiapi.h:151