Instrument Neutral Distributed Interface INDI
1.9.5
|
Go to the documentation of this file.
29 for (
int i = 0; i < 4; ++i) {
30 num = num << 8 |
buffer[position + i];
56 std::stringstream outputStream;
58 for (
int i = 0; i < (int)
sizeof(
buffer); i++) {
59 outputStream << std::hex << (int)
buffer[i];
62 IDLog(
"%s\r\n", outputStream.str().c_str());
68 std::stringstream sst;
70 sst <<
"Current device (v " <<
72 <<
") state : (fan=" << std::to_string((
buffer[7] & 32) != 0) <<
76 IDLog(
"%s\r\n", sst.str().c_str());
83 std::mutex ActiveFocuserUtils::Poller::mutex_;
96 std::lock_guard<std::mutex> lock(mutex_);
97 if (pinstance_ ==
nullptr) {
107 while (
futureObjSender.wait_for(std::chrono::milliseconds(1000)) == std::future_status::timeout) {
115 IDLog(
"Unable to write \r\n");
123 while (
futureObj.wait_for(std::chrono::milliseconds(1)) == std::future_status::timeout) {
125 unsigned char buf[256];
129 if (buf[0] == 0x3C) {
134 std::stringstream ssVersion;
150 IDLog(
"Unable to read \r\n");
165 IDLog(
"Poller started\r\n");
179 IDLog(
"Poller stopped\r\n");
189 static int CurrentPositionStep;
190 static double CurrentPosition;
191 static bool IsOrigin;
194 static bool IsMoving;
195 static char * HardwareRevision;
199 static double AirTemperature;
200 static double TubeTemperature;
201 static double MirrorTemperature;
206 return CurrentPositionStep;
210 CurrentPositionStep = currentPositionStep;
214 return CurrentPosition;
221 bool ActiveFocuserUtils::SystemState::GetIsOrigin() {
254 return HardwareRevision;
258 HardwareRevision = hardwareRevision;
286 return AirTemperature;
290 AirTemperature = airTemperature;
294 return TubeTemperature;
298 TubeTemperature = tubeTemperature;
302 return MirrorTemperature;
306 MirrorTemperature = mirrorTemperature;
313 {ActiveFocuserUtils::Commands::ZERO, 0x03},
314 {ActiveFocuserUtils::Commands::RELEASE, 0x04},
315 {ActiveFocuserUtils::Commands::FREE, 0x06},
316 {ActiveFocuserUtils::Commands::AUTO, 0x07},
317 {ActiveFocuserUtils::Commands::MOVE, 0x09},
318 {ActiveFocuserUtils::Commands::STOP, 0x0A},
319 {ActiveFocuserUtils::Commands::FAN_ON, 0x0B},
320 {ActiveFocuserUtils::Commands::FAN_OFF, 0x0C},
321 {ActiveFocuserUtils::Commands::RESET, 0x7E},
322 {ActiveFocuserUtils::Commands::DUMMY, 0xFF},
static bool GetIsMoving()
static void SetIsMoving(bool isMoving)
static void SetIsFanOn(bool isFanOn)
static void PrintBasicDeviceData(const unsigned char *buffer)
int HID_API_EXPORT hid_write(hid_device *dev, const unsigned char *data, size_t length)
Write an Output report to a HID device.
static double GetCurrentPosition()
std::promise< void > exitSignal
static double GetMirrorTemperature()
std::future< void > futureObjSender
int HID_API_EXPORT hid_read(hid_device *dev, unsigned char *data, size_t length)
Read an Input report from a HID device.
static Poller * GetInstance(hid_device &hid_handle)
static double TicksToMillimeters(int ticks)
std::future< void > futureObj
unsigned char poller_buffer[60]
void threaded_sender(std::future< void > futureObjSender)
static int Get32(const unsigned char *buffer, int position)
void void void void void IDLog(const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(1
Function Drivers call to log a message locally.
static void SetIsHold(bool isHold)
void threaded_poller(std::future< void > futureObj)
static double GetTubeTemperature()
static const std::map< Commands, unsigned char > CommandsMap
static int Get16(const unsigned char *buffer, int position)
static void SetCurrentPositionStep(int currentPositionStep)
static int GetCurrentPositionStep()
static double GetAirTemperature()
static void SetSpan(int span)
std::promise< void > exitSignalSender
static void SetAirTemperature(double airTemperature)
static void SetCurrentPosition(double currentPosition)
static void SetImmpp(int immpp)
static void SetIsOrigin(bool isOrigin)
static void SetMmpp(double mmpp)
static int MillimetersToTicks(double millimeters)
static char * GetHardwareRevision()
static void SetMirrorTemperature(double mirrorTemperature)
static void SetHardwareRevision(char *hardwareRevision)
static void SetTubeTemperature(double tubeTemperature)
static void PrintFrame(const unsigned char *buffer)
std::vector< uint8_t > buffer