|
Instrument Neutral Distributed Interface INDI 2.2.5
|
#include <protocol.h>
Classes | |
| struct | ConnectionCallbackEntry |
| struct | TelemetryCallbackEntry |
Public Types | |
| enum class | DirectQueryStatus { Success , Timeout , UnexpectedFrame , WriteFailed , MalformedResponse } |
| using | TelemetryCallback = std::function< void(const TelemetrySnapshot &)> |
| using | TelemetryCallbackHandle = std::uint64_t |
| using | ConnectionCallback = std::function< void(ConnectionEvent)> |
| using | ConnectionCallbackHandle = std::uint64_t |
| using | InstrumentationListener = instrumentation::Dispatcher::Listener |
| using | InstrumentationListenerHandle = instrumentation::Dispatcher::ListenerHandle |
| using | StatusVerifier = std::function< bool(const StatusFrame &)> |
Public Member Functions | |
| GeminiProtocol () | |
| ~GeminiProtocol () | |
| bool | open (const std::string &port, int settleMs=0) |
| bool | open (const std::string &port, int settleMs, bool exclusive) |
| void | close () |
| bool | isOpen () const |
| int | lastOpenErrno () const |
| bool | lastOpenWasBusy () const |
| int | connect (const std::string &port, int settleMs=0) |
| int | reconnect () |
| void | disconnect () |
| bool | handshake () |
| bool | readFirmware (std::string &raw, int &numeric) |
| DirectQueryStatus | queryIdentity (std::string &identity, int timeoutMs, std::string *detail=nullptr) |
| DirectQueryStatus | queryFirmware (std::string &raw, int &numeric, int timeoutMs, std::string *detail=nullptr) |
| bool | firmwareVersion (std::string &raw, int &numeric) const |
| bool | latestStatus (StatusFrame &out, unsigned long long &frameSeq) |
| bool | waitForFrameAfter (unsigned long long minSeq, int timeoutMs) |
| bool | waitForFrameAfter (unsigned long long minSeq, int timeoutMs, StatusFrame &out, unsigned long long &frameSeq) |
| bool | waitForVerifiedState (unsigned long long preWriteSeq, StatusVerifier verifier, int timeoutMs, std::string &error, unsigned long long &verifiedSeq) |
| TelemetryCallbackHandle | registerTelemetryCallback (TelemetryCallback callback) |
| bool | removeTelemetryCallback (TelemetryCallbackHandle handle) |
| ConnectionCallbackHandle | registerConnectionCallback (ConnectionCallback callback) |
| bool | removeConnectionCallback (ConnectionCallbackHandle handle) |
| void | setInstrumentationLevel (instrumentation::Level level) |
| instrumentation::Level | instrumentationLevel () const |
| bool | instrumentationEnabled (instrumentation::Level level) const |
| InstrumentationListenerHandle | registerInstrumentationListener (InstrumentationListener listener) |
| bool | removeInstrumentationListener (InstrumentationListenerHandle handle) |
| int | setOutputSync (unsigned firmwareIndex, bool enabled) |
| int | setDewModeSync (unsigned channel, DewMode mode) |
| int | setDewManualPercentSync (unsigned channel, unsigned percent) |
| int | setDewEnabledSync (unsigned channel, bool enabled) |
| int | setOutput (unsigned firmwareIndex, bool enabled) |
| int | setDewMode (unsigned channel, DewMode mode) |
| int | setDewManualPercent (unsigned channel, unsigned percent) |
| int | setDewEnabled (unsigned channel, bool enabled) |
| int | recoverStream () |
| void | setCancelFunction (std::function< bool()> fn) |
| bool | parseStatusPayload (const std::string &payload, StatusFrame &status, std::string &error) const |
Public Attributes | |
| std::atomic< bool > | running_ {true} |
| std::atomic< bool > | sessionStopRequested_ {false} |
| std::atomic< bool > | reconnectPending_ {false} |
| std::atomic< bool > | recoveryAttempted_ {false} |
| std::atomic< bool > | acceptingWrites_ {false} |
Definition at line 47 of file protocol.h.
| using geminipbh::GeminiProtocol::ConnectionCallback = std::function<void(ConnectionEvent)> |
Definition at line 52 of file protocol.h.
| using geminipbh::GeminiProtocol::ConnectionCallbackHandle = std::uint64_t |
Definition at line 53 of file protocol.h.
Definition at line 54 of file protocol.h.
| using geminipbh::GeminiProtocol::InstrumentationListenerHandle = instrumentation::Dispatcher::ListenerHandle |
Definition at line 55 of file protocol.h.
| using geminipbh::GeminiProtocol::StatusVerifier = std::function<bool(const StatusFrame &)> |
Definition at line 119 of file protocol.h.
| using geminipbh::GeminiProtocol::TelemetryCallback = std::function<void(const TelemetrySnapshot &)> |
Definition at line 50 of file protocol.h.
| using geminipbh::GeminiProtocol::TelemetryCallbackHandle = std::uint64_t |
Definition at line 51 of file protocol.h.
|
strong |
| Enumerator | |
|---|---|
| Success | |
| Timeout | |
| UnexpectedFrame | |
| WriteFailed | |
| MalformedResponse | |
Definition at line 57 of file protocol.h.
| geminipbh::GeminiProtocol::GeminiProtocol | ( | ) |
Definition at line 81 of file protocol.cpp.
| geminipbh::GeminiProtocol::~GeminiProtocol | ( | ) |
Definition at line 82 of file protocol.cpp.
| void geminipbh::GeminiProtocol::close | ( | ) |
Definition at line 187 of file protocol.cpp.
| int geminipbh::GeminiProtocol::connect | ( | const std::string & | port, |
| int | settleMs = 0 |
||
| ) |
Definition at line 1741 of file protocol.cpp.
| void geminipbh::GeminiProtocol::disconnect | ( | ) |
Definition at line 2063 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::firmwareVersion | ( | std::string & | raw, |
| int & | numeric | ||
| ) | const |
Definition at line 714 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::handshake | ( | ) |
Definition at line 702 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::instrumentationEnabled | ( | instrumentation::Level | level | ) | const |
Definition at line 223 of file protocol.cpp.
| instrumentation::Level geminipbh::GeminiProtocol::instrumentationLevel | ( | ) | const |
Definition at line 218 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::isOpen | ( | ) | const |
Definition at line 198 of file protocol.cpp.
| int geminipbh::GeminiProtocol::lastOpenErrno | ( | ) | const |
Definition at line 203 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::lastOpenWasBusy | ( | ) | const |
Definition at line 208 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::latestStatus | ( | StatusFrame & | out, |
| unsigned long long & | frameSeq | ||
| ) |
Definition at line 876 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::open | ( | const std::string & | port, |
| int | settleMs, | ||
| bool | exclusive | ||
| ) |
Definition at line 97 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::open | ( | const std::string & | port, |
| int | settleMs = 0 |
||
| ) |
Definition at line 92 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::parseStatusPayload | ( | const std::string & | payload, |
| StatusFrame & | status, | ||
| std::string & | error | ||
| ) | const |
Definition at line 818 of file protocol.cpp.
| GeminiProtocol::DirectQueryStatus geminipbh::GeminiProtocol::queryFirmware | ( | std::string & | raw, |
| int & | numeric, | ||
| int | timeoutMs, | ||
| std::string * | detail = nullptr |
||
| ) |
Definition at line 681 of file protocol.cpp.
| GeminiProtocol::DirectQueryStatus geminipbh::GeminiProtocol::queryIdentity | ( | std::string & | identity, |
| int | timeoutMs, | ||
| std::string * | detail = nullptr |
||
| ) |
Definition at line 657 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::readFirmware | ( | std::string & | raw, |
| int & | numeric | ||
| ) |
Definition at line 709 of file protocol.cpp.
| int geminipbh::GeminiProtocol::reconnect | ( | ) |
Definition at line 1969 of file protocol.cpp.
| int geminipbh::GeminiProtocol::recoverStream | ( | ) |
Definition at line 1526 of file protocol.cpp.
| GeminiProtocol::ConnectionCallbackHandle geminipbh::GeminiProtocol::registerConnectionCallback | ( | ConnectionCallback | callback | ) |
Definition at line 919 of file protocol.cpp.
| GeminiProtocol::InstrumentationListenerHandle geminipbh::GeminiProtocol::registerInstrumentationListener | ( | InstrumentationListener | listener | ) |
Definition at line 228 of file protocol.cpp.
| GeminiProtocol::TelemetryCallbackHandle geminipbh::GeminiProtocol::registerTelemetryCallback | ( | TelemetryCallback | callback | ) |
Definition at line 885 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::removeConnectionCallback | ( | ConnectionCallbackHandle | handle | ) |
Definition at line 930 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::removeInstrumentationListener | ( | InstrumentationListenerHandle | handle | ) |
Definition at line 234 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::removeTelemetryCallback | ( | TelemetryCallbackHandle | handle | ) |
Definition at line 896 of file protocol.cpp.
|
inline |
Definition at line 170 of file protocol.h.
| int geminipbh::GeminiProtocol::setDewEnabled | ( | unsigned | channel, |
| bool | enabled | ||
| ) |
Definition at line 1519 of file protocol.cpp.
| int geminipbh::GeminiProtocol::setDewEnabledSync | ( | unsigned | channel, |
| bool | enabled | ||
| ) |
Definition at line 1491 of file protocol.cpp.
| int geminipbh::GeminiProtocol::setDewManualPercent | ( | unsigned | channel, |
| unsigned | percent | ||
| ) |
Definition at line 1512 of file protocol.cpp.
| int geminipbh::GeminiProtocol::setDewManualPercentSync | ( | unsigned | channel, |
| unsigned | percent | ||
| ) |
Definition at line 1484 of file protocol.cpp.
| int geminipbh::GeminiProtocol::setDewMode | ( | unsigned | channel, |
| DewMode | mode | ||
| ) |
Definition at line 1505 of file protocol.cpp.
| int geminipbh::GeminiProtocol::setDewModeSync | ( | unsigned | channel, |
| DewMode | mode | ||
| ) |
Definition at line 1477 of file protocol.cpp.
| void geminipbh::GeminiProtocol::setInstrumentationLevel | ( | instrumentation::Level | level | ) |
Definition at line 213 of file protocol.cpp.
| int geminipbh::GeminiProtocol::setOutput | ( | unsigned | firmwareIndex, |
| bool | enabled | ||
| ) |
Definition at line 1498 of file protocol.cpp.
| int geminipbh::GeminiProtocol::setOutputSync | ( | unsigned | firmwareIndex, |
| bool | enabled | ||
| ) |
Definition at line 1470 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::waitForFrameAfter | ( | unsigned long long | minSeq, |
| int | timeoutMs | ||
| ) |
Definition at line 1306 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::waitForFrameAfter | ( | unsigned long long | minSeq, |
| int | timeoutMs, | ||
| StatusFrame & | out, | ||
| unsigned long long & | frameSeq | ||
| ) |
Definition at line 1314 of file protocol.cpp.
| bool geminipbh::GeminiProtocol::waitForVerifiedState | ( | unsigned long long | preWriteSeq, |
| StatusVerifier | verifier, | ||
| int | timeoutMs, | ||
| std::string & | error, | ||
| unsigned long long & | verifiedSeq | ||
| ) |
Definition at line 1329 of file protocol.cpp.
| std::atomic<bool> geminipbh::GeminiProtocol::acceptingWrites_ {false} |
Definition at line 204 of file protocol.h.
| std::atomic<bool> geminipbh::GeminiProtocol::reconnectPending_ {false} |
Definition at line 202 of file protocol.h.
| std::atomic<bool> geminipbh::GeminiProtocol::recoveryAttempted_ {false} |
Definition at line 203 of file protocol.h.
| std::atomic<bool> geminipbh::GeminiProtocol::running_ {true} |
Definition at line 200 of file protocol.h.
| std::atomic<bool> geminipbh::GeminiProtocol::sessionStopRequested_ {false} |
Definition at line 201 of file protocol.h.