28#ifdef _USE_SYSTEM_JSONLIB
29#include <nlohmann/json.hpp>
43 virtual bool Connect()
override;
52 virtual bool Goto(
double ra,
double dec)
override;
53 virtual bool Sync(
double ra,
double dec)
override;
54 virtual bool Abort()
override;
57 virtual bool Park()
override;
58 virtual bool UnPark()
override;
64 virtual bool SetTrackRate(
double raRate,
double deRate)
override;
74 virtual bool updateLocation(
double latitude,
double longitude,
double elevation)
override;
77 virtual bool updateTime(ln_date *utc,
double utc_offset)
override;
81 double m_currentRA { 0 };
82 double m_currentDEC { 90 };
83 double m_currentAz { 180 };
84 double m_currentAlt { 0 };
85 double m_targetRA { 0 };
86 double m_targetDEC { 0 };
87 double m_sinLat, m_cosLat;
89 bool isSlewing{
false};
90 bool isTracking{
false};
91 double currentSlewRate{0.5};
94 bool m_CanSlewAsync{
false};
98 std::vector<int> m_TrackModeAlpacaRates;
101 bool m_CanSetRaRate{
false};
102 bool m_CanSetDecRate{
false};
107 unsigned int DBG_SCOPE { 0 };
118 std::unique_ptr<httplib::Client> httpClient;
119 int m_DeviceNumber{0};
121 int m_TransactionID{0};
125 enum { DESCRIPTION, DRIVER_INFO, DRIVER_VERSION, INTERFACE_VERSION };
128 std::string getAlpacaURL(
const std::string& endpoint);
129 int getTransactionId()
131 return ++m_TransactionID;
133 bool sendAlpacaGET(
const std::string& endpoint,
nlohmann::json& response);
virtual bool Goto(double ra, double dec) override
Move the scope to the supplied RA and DEC coordinates.
virtual bool Disconnect() override
Disconnect from device.
virtual bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
virtual bool ReadScopeStatus() override
Read telescope status.
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
virtual const char * getDefaultName() override
virtual bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool Sync(double ra, double dec) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
virtual bool Handshake() override
perform handshake with device to check communication
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
virtual bool SetTrackMode(uint8_t mode) override
SetTrackMode Set active tracking mode. Do not change track state.
virtual ~alpacaTelescopeDriver()=default
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Start or Stop the telescope motion in the direction dir.
virtual bool Park() override
Park the telescope to its home position.
virtual bool SetTrackRate(double raRate, double deRate) override
SetTrackRate Set custom tracking rates.
a class to store JSON values