Instrument Neutral Distributed Interface INDI  2.0.2
Excalibur.h
Go to the documentation of this file.
1 
2 #pragma once
3 
5 #include "defaultdevice.h"
6 #include "indidustcapinterface.h"
7 
9 {
10  public:
11  Excalibur();
12  virtual ~Excalibur() override = default;
13 
14  const char *getDefaultName() override;
15  virtual bool initProperties() override;
16  virtual bool updateProperties() override;
17 
18  virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
19  virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
20  virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
21  virtual bool ISSnoopDevice(XMLEle *root) override;
22  virtual void TimerHit() override;
23 
24  protected:
25  virtual bool SetLightBoxBrightness(uint16_t value) override;
26  virtual bool EnableLightBox(bool enable) override;
27  virtual bool saveConfigItems(FILE *fp) override;
28  virtual IPState ParkCap() override;
29  virtual IPState UnParkCap() override;
30 
31 
32  private:
33  bool Ack();
34  int PortFD{ -1 };
35  bool sendCommand(const char * cmd, char * res = nullptr);
36  void updateFirmwareVersion();
37  void deviceStatus();
38  bool getStartupData();
39  // Firmware version
40 
41  ITextVectorProperty StatusTP;
42  IText StatusT[2] {};
43  static const uint32_t DRIVER_RES { 32 };
44 
45  static const char DRIVER_DEL { '#' };
46  static const char DRIVER_DEL2 { ' ' };
47 
48  static const uint8_t DRIVER_TIMEOUT { 10 };
49  Connection::Serial *serialConnection{ nullptr };
50 };
The Serial class manages connection with serial devices including Bluetooth. Serial communication is ...
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
Definition: Excalibur.cpp:262
virtual bool ISSnoopDevice(XMLEle *root) override
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
Definition: Excalibur.cpp:255
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition: Excalibur.cpp:58
virtual bool EnableLightBox(bool enable) override
EnableLightBox Turn on/off on a light box. Must be impelemented in the child class.
Definition: Excalibur.cpp:116
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: Excalibur.cpp:26
virtual IPState ParkCap() override
Park dust cap (close cover). Must be implemented by child.
Definition: Excalibur.cpp:171
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
Definition: Excalibur.cpp:223
virtual ~Excalibur() override=default
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
Definition: Excalibur.cpp:204
virtual bool SetLightBoxBrightness(uint16_t value) override
setBrightness Set light level. Must be impelemented in the child class, if supported.
Definition: Excalibur.cpp:148
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Definition: Excalibur.cpp:242
virtual IPState UnParkCap() override
unPark dust cap (open cover). Must be implemented by child.
Definition: Excalibur.cpp:188
const char * getDefaultName() override
Definition: Excalibur.cpp:83
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
Definition: Excalibur.cpp:231
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
ISState
Switch state.
Definition: indiapi.h:150
IPState
Property state.
Definition: indiapi.h:160
__u8 cmd[4]
Definition: pwc-ioctl.h:2
One text descriptor.
Text vector property descriptor.
Definition: indiapi.h:246