×

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

Bi-monthly release with minor bug fixes and improvements

New to client development

  • Posts: 11
  • Thank you received: 1
Hello All,

I'm moving my first steps into client development with INDI. I have tried the example client and I understood they way it works, but some questions are bugging me.
- the sample client shows the connection to a single driver, but how about I have to orchestrate many drivers? Should I put as many watchDevice as needed?
- the same sample client specifies the driver to connect and talk to, but how do I collect at the beginning the instrument types available? That's to say, I have one mount, two cameras, two focusers, one dome, etc...together with the driver name
- what if I don't want to specify a property, but I rather want to get all from a driver?

clear skies
Nicola
The following user(s) said Thank You: Jasem Mutlaq
1 year 1 month ago #91463

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

Hello Nicola and welcome to INDI! Very good question so this is why in KStars, we use different method. Check out the Client Manager code. Specifically, see this section:
protected:
        virtual void newDevice(INDI::BaseDevice dp) override;
        virtual void removeDevice(INDI::BaseDevice dp) override;
 
        virtual void newProperty(INDI::Property prop) override;
        virtual void updateProperty(INDI::Property prop) override;
        virtual void removeProperty(INDI::Property prop) override;
 
        virtual void newMessage(INDI::BaseDevice dp, int messageID) override;
        virtual void newUniversalMessage(std::string message) override;
 
        virtual void serverConnected() override;
        virtual void serverDisconnected(int exitCode) override;

Here we receive everything. If a new device is discovered, we get it in newDevice(...), if a new property is defined then it's newProperty(...) and so forth. We don't use watchXXX for the same reasons you mentioned. They're good if you want to specifically target a device/property, but for a generic client you can follow KStars's approach.
1 year 1 month ago #91515

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

Time to create page: 0.721 seconds