×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Calling a drivers methods from a different driver

  • Posts: 554
  • Thank you received: 138
I'm looking at extending the Celestron focuser driver so it can use the Celestron telescope connection instead of its own USB serial connection.

From the user perspective it looks as if the best way will be to extend the existing Celestron SCT focuser driver.
I've set up a switch that gives the user the ability to choose what control method to use - USB or Telescope - but where I'm stuck is how to give the focuser driver assess to the telescope control class CelestronDriver.

The specific method I want to use is the CelestronDriver::send_passthrough(...) method. I'll probably need access to a few others such as check_connection().
What I'm looking for is a way to pass the Telescope's CelestronDriver instantiation to the focuser. It would probably need to be a pointer I guess.

Does anyone have any suggestions for how this could be done?
Or is there a different way? I wondered about the Snoop mechanism, I could build the command into an XML format string, send it and wait for a reply. The telescope driver would parse it, call send_passthrough and return the reply.
But Snoop seems only to be for INDI properties - or is it?

I suspect this is either trivial and I've missed something obvious or very difficult.
5 years 1 month ago #35899

Please Log in or Create an account to join the conversation.

Snoop works by listening to properties defined by other drivers and acting on it. There is not way to do RCP in INDI.

For the Celestron SCT, you would edit celestrongps.* and celestrondriver.* to include such functionality. Might have to copy some code from the Celestron SCT driver. The celestrondriver.cpp already has a send_passthrough function defined, so maybe it's just perhaps a matter of extending INDI::FocuserInterface (just like OnStep driver) and implementing the corresponding functions.

Though you'd probably have to add a check of some sort in Handshake() to figure out whether a focuser is available or not in order to know whether to define the properties or not in updateProperties(..)
The following user(s) said Thank You: Chris Rowland
5 years 1 month ago #35963

Please Log in or Create an account to join the conversation.

  • Posts: 554
  • Thank you received: 138
I had come to much the same conclusion, thanks.
I've found the OnStep driver and been copying that and got it working a few minutes ago.
It seems easy enough to check, I look for the focuser firmware version, if there isn't one then I don't implement it.
It's a separate driver so very litle commonality.

The CelestronGPS is a pretty busy driver, the new focus tab runs off the end of the window.
Chris
The following user(s) said Thank You: Jasem Mutlaq
5 years 1 month ago #35996

Please Log in or Create an account to join the conversation.

  • Posts: 328
  • Thank you received: 53
Trying to learn what snoop does a search brought me here.
So my SNAPCAP defaults to snoops filter simulator ????? (why would it care about the filter?)
Wouldn't it want to snoop the camera ? open if exposure is asked for? or snooth the dome to make sure it's open?
My snapcap can't be opened or closed with the shutter closed. (I wonder if there a way to make that happen?)
Else I'll try to keep snapcap "manually" activated?

also I have the dome snoop the astrophysics experimental? and weather I have the weather watcher ?
I suspect it will check for clouds in WW and check for shutter alignment from the mount?
AP Mach1 / CP4 APCC & PEMpro.
EXP SCI - ED152cf APO - Celestron 11" RASA - Stellarvue 80mm
Baader F2 HS NB filters, Lodestar X2 guide camera / OAG - ZWO 290mm mini
ZWO ASI1600MM Pro / ASI174M (solar) / ASI094MC
NEXDome, CLoudwatcher, AVX mount/ASIair and Stellarmate

5 years 1 month ago #36719

Please Log in or Create an account to join the conversation.

Time to create page: 0.318 seconds