Hi Jasem,

knro wrote: For device type, property DRIVER_INFO.DRIVER_INTERFACE contains ORed values of Driver Interfaces . You can then know from that the type of the device. Not sure if there is a built in functionality for this in PyINDI.

Something like this is what I need. Given the complete lack of documentation, however, it's impossible for me to find out myself how to access this info. You are right that PyIndi documentation is even worse than the rest. This really makes using PyIndi an extremely frustrating experience! I again had to do random experiments for several hours without success.

I found that there is a DRIVER_INFO property vector for drivers in PyIndi. I then tried to access the details of it. For example using this code:
driver_info = monitored_device.getText("DRIVER_INFO")
while not driver_info:
    driver_info = monitored_device.getText("DRIVER_INFO")
    time.sleep(0.05)

print ("DRIVER_INFO has type: " + str(type(driver_info)))
for element in driver_info:
    print(driver_info[0].text
The printed type of DRIVER_INFO turned out to be <class 'PyIndi.ITextVectorProperty'>. The elements of driver_info printed out as:
Telescope Simulator
indi_simulator_telescope
1.0
5
I guess that the first entry is the device name, the second the executable, the third is the version number, and the fourth one I don't know. So, this does not help.

Again by trial and error I then found that there is a function
monitored_device.getDriverInterface()
When I call it, I get a <Swig Object of type 'uint16_t *' >. This seems to correspond to the definitions in your C++ code:
/**
     * @brief The DRIVER_INTERFACE enum defines the class of devices the driver implements. A driver may implement one or more interfaces.
     */
    enum DRIVER_INTERFACE
    {
        GENERAL_INTERFACE   = 0,         /**< Default interface for all INDI devices */
        TELESCOPE_INTERFACE = (1 << 0),  /**< Telescope interface, must subclass INDI::Telescope */
        CCD_INTERFACE       = (1 << 1),  /**< CCD interface, must subclass INDI::CCD */
        GUIDER_INTERFACE    = (1 << 2),  /**< Guider interface, must subclass INDI::GuiderInterface */
        FOCUSER_INTERFACE   = (1 << 3),  /**< Focuser interface, must subclass INDI::FocuserInterface */
        FILTER_INTERFACE    = (1 << 4),  /**< Filter interface, must subclass INDI::FilterInterface */
        DOME_INTERFACE      = (1 << 5),  /**< Dome interface, must subclass INDI::Dome */
        GPS_INTERFACE       = (1 << 6),  /**< GPS interface, must subclass INDI::GPS */
        WEATHER_INTERFACE   = (1 << 7),  /**< Weather interface, must subclass INDI::Weather */
        AO_INTERFACE        = (1 << 8),  /**< Adaptive Optics Interface */
        DUSTCAP_INTERFACE   = (1 << 9),  /**< Dust Cap Interface */
        LIGHTBOX_INTERFACE  = (1 << 10), /**< Light Box Interface */
        DETECTOR_INTERFACE  = (1 << 11), /**< Detector interface, must subclass INDI::Detector */
        ROTATOR_INTERFACE   = (1 << 12), /**< Rotator interface, must subclass INDI::RotatorInterface */
        AUX_INTERFACE       = (1 << 15), /**< Auxiliary interface */
};
Is there any way I can compare the Swig object with some "TELESCOPE_INTERFACE" PyIndi constant? Is there a list of all PyIndi constants?

It would be sad if I had to give up on INDI at this point. So I really would very much appreciate if someone who knows about PyIndi could help me.

All the best,
Rolf

Read More...