Skip to content

Commit

Permalink
Add missing ISNewXXX handlers in the driver
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Jul 27, 2024
1 parent f12c9f4 commit 87717bf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
30 changes: 30 additions & 0 deletions indi-gpio/indi_gpio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,33 @@ void INDIGPIO::TimerHit()

SetTimer(getPollingPeriod());
}

////////////////////////////////////////////////////////////////////////////////////////
///
////////////////////////////////////////////////////////////////////////////////////////
bool INDIGPIO::ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
{
if (dev && !strcmp(dev, getDeviceName()))
{
if (INDI::OutputInterface::processSwitch(dev, name, states, names, n))
return true;
}

return INDI::DefaultDevice::ISNewSwitch(dev, name, states, names, n);
}

////////////////////////////////////////////////////////////////////////////////////////
///
////////////////////////////////////////////////////////////////////////////////////////
bool INDIGPIO::ISNewText(const char * dev, const char * name, char * texts[], char * names[], int n)
{
if (dev && !strcmp(dev, getDeviceName()))
{
if (INDI::InputInterface::processText(dev, name, texts, names, n))
return true;
if (INDI::OutputInterface::processText(dev, name, texts, names, n))
return true;
}

return INDI::DefaultDevice::ISNewText(dev, name, texts, names, n);
}
3 changes: 3 additions & 0 deletions indi-gpio/indi_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class INDIGPIO : public INDI::DefaultDevice, public INDI::InputInterface, public
virtual bool updateProperties() override;
virtual void ISGetProperties(const char *dev);

virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
virtual bool ISNewText(const char * dev, const char * name, char * texts[], char * names[], int n) override;

protected:

/**
Expand Down

0 comments on commit 87717bf

Please sign in to comment.