thouslite_controller/thouslite_controller.h Source File

1 [[PREPROC_HEADER_GUARD_BEGIN]]
2 
3 #include <HC_API.h>
4 #include <controllers_utils.h>
5 
6 namespace ControlAPI {
7  const std::string Thouslite_NALPCODE = "THOUS";
8 
12  const std::string ThousliteRecipeDescriptions[14] = {
13  "White (Broad spectrum)",
14  "Orange (585nm)",
15  "Lt Orange (Broad spectrum)",
16  "Blue-Green (480nm)",
17  "Red (660nm)",
18  "Green-Blue (505nm)",
19  "Green (520nm)",
20  "Blue (445nm)",
21  "Lt Violet (420nm)",
22  "Red (635nm)",
23  "Yellow-Grn (545nm)",
24  "Dk Violet (405nm)",
25  "Red (670nm)",
26  "Red/IR (700/850nm)"
27  };
28 
33  public:
34  HC_CLASS_DEVICECOMMANDPACKAGE_META(ThousliteCommand_SetLighting)
35 
36  virtual ~ThousliteCommand_SetLighting() = default;
37 
38  virtual void cloneFrom(DeviceCommandPackage* other) override;
39 #ifdef HC_API_FEATURE_NETWORKING
40  virtual void syncFromNetwork(CommandStatus* command) override;
41 #endif
42  unsigned int recipe[14];
61  };
62 
63  class ThousliteDeviceInfo;
64  class ThousliteController_Internals;
65 
69  class HC_API ThousliteDeviceInfo : public DeviceInfo {
70  public:
71  HC_CLASS_META(ThousliteDeviceInfo)
72  HC_SWIG_SHAREDPTR(ThousliteDeviceInfo)
73  HC_CLASS_DEVICEINFO_META(ThousliteDeviceInfo, CommandStatus)
74 
75  friend class ThousliteController;
76  friend class ThousliteComHandler;
77  friend class ThousliteController;
78 
79  virtual ~ThousliteDeviceInfo() = default;
80 
81 
83  unsigned char cubeId[4] = {0x0, 0x0, 0x0, 0x0};
84  protected:
85 
86 #ifdef HC_API_MACRO_EXCLUDE_DOCS
87  bool powerState = false;
88 
89 #endif
90  };
91 
96  public:
97  HC_CLASS_META(ThousliteController)
98  HC_SWIG_SHAREDPTR(ThousliteController)
99 
100  friend class ThousliteDeviceInfo;
101 
102  virtual ~ThousliteController() = default;
103 #ifdef HC_API_MACRO_EXCLUDE_DOCS
104  virtual bool init() override;
105  virtual bool issueCommand(CommandStatus* command) override;
106 #endif
107  int baudrate = 115200;
112 
116  int apiMajorVersion = 1;
117 
118  private:
119  virtual void disconnect(bool expected = false) override;
120  int comPortNumber = -1;
121 
122 
123  std::shared_ptr<ThousliteController_Internals> internals;
124  };
125 
126 
127 
128 
129 
130 }
131 
132 
133 [[PREPROC_HEADER_GUARD_END]]