×
INDI Library v1.8.6 Released (21 Aug 2020)

August 2020 release of INDI Library v1.8.6 introduces new drivers while providing fixes and improvements to existing devices and core framework.

getDriverInterface returns only 0

7 months 1 week ago
emk
Junior Boarder
Junior Boarder
Posts: 35
More
Topic Author
getDriverInterface returns only 0 #49400
Hey,
it's pretty much the title. I can't figure out what devices I'm receiving. Of course I know, but my client only sees, driver interface is 0, so it's useless. Am I doing anything wrong?
void client::newDevice(INDI::BaseDevice* dp)
{
  log("CLI:\tnew device: %s", dp->getDeviceName());
  
  uint16_t driver_interface = dp->getDriverInterface();
  log("driver_interface: %d", driver_interface);
  if( driver_interface & INDI::BaseDevice::DRIVER_INTERFACE::TELESCOPE_INTERFACE )
  {
    if (int_telescope==NULL && ( !strcmp(dp->getDeviceName(), TELE) || !strcmp(dp->getDeviceName(), TELE_SIM) ))
    {
      log("CLI:\tReceived Telescope:\t%s...", dp->getDeviceName());
  //     telescope = dp;
      int_telescope = new cl_TelescopeInterface(dp, this);
    }
    else if(int_telescope==NULL && !strcmp(dp->getDeviceName(), TELE_STAN))
    {
      log("CLI:\tReceived Telescope:\t%s...", dp->getDeviceName());
  //     telescope = dp;
  //     int_telescope = new cl_TelescopeInterface(dp, this);
      int_telescope = new cl_TelescopeHondelage(dp, this);

    }
    
    connect(int_telescope, SIGNAL(reachedTarget()), this, SLOT(reachedTarget()));
//     connect(int_telescope, SIGNAL(reachedTarget()), this, SLOT(setNewTransit()));
    connect(int_telescope, SIGNAL(reachedTarget()), this, SLOT(writeImageInfo2File()));
    connect(int_telescope, SIGNAL(slewingError()), this, SLOT(slewingError()));
  }
  else if( driver_interface & INDI::BaseDevice::DRIVER_INTERFACE::CCD_INTERFACE)
  {
    addCamera(dp);
  }
  else if( driver_interface & INDI::BaseDevice::DRIVER_INTERFACE::AUX_INTERFACE)
  {
    if (int_joystick==NULL && (!strcmp(dp->getDeviceName(), JOYSTICK)))
    {
      log("CLI:\tReceived Joystick:\t%s...", dp->getDeviceName());
      int_joystick = new cl_JoystickWingman(dp, this);
    }
}
  }

that second log statement always returns zero. I tried so far a few simulator drivers and the lx200gps and they all returned zero when asked for their interface.

Thanks in advance!

Cheers
Erik


INDI Library: 1.8.2
Code 1.8.2-tgz. Protocol 1.7.

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

6 months 4 weeks ago
knro
Administrator
Administrator
Posts: 8370
Karma: 51
getDriverInterface returns only 0 #49951
So you probably need to wait until that property is defined first. So in newProperty, check for DRIVER_INFO property. This is what I use in KStars:
if (!strcmp(prop->getName(), "DRIVER_INFO"))
    {
        ITextVectorProperty *tvp = prop->getText();
        if (tvp)
        {
            IText *tp = IUFindText(tvp, "DRIVER_INTERFACE");
            if (tp)
            {
                driverInterface = static_cast<uint32_t>(atoi(tp->text));
                emit interfaceDefined();
            }

            tp = IUFindText(tvp, "DRIVER_VERSION");
            if (tp)
            {
                driverVersion = QString(tp->text);
            }
        }
    }

Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
The following user(s) said Thank You emk

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

Time to create page: 0.262 seconds