Instrument Neutral Distributed Interface INDI  2.0.2
simpledevice.cpp

A very minimal device! It also allows you to connect/disconnect and performs no other functions.

/*
INDI Developers Manual
Tutorial #1
"Hello INDI"
We construct a most basic (and useless) device driver to illustrate INDI.
Refer to README, which contains instruction on how to build this driver, and use it
with an INDI-compatible client.
*/
#include "simpledevice.h"
#include <memory>
std::unique_ptr<SimpleDevice> simpleDevice(new SimpleDevice());
/**************************************************************************************
** Client is asking us to establish connection to the device
***************************************************************************************/
{
IDMessage(getDeviceName(), "Simple device connected successfully!");
return true;
}
/**************************************************************************************
** Client is asking us to terminate connection to the device
***************************************************************************************/
{
IDMessage(getDeviceName(), "Simple device disconnected successfully!");
return true;
}
/**************************************************************************************
** INDI is asking us for our default device name
***************************************************************************************/
{
return "Simple Device";
}
const char * getDeviceName() const
Definition: basedevice.cpp:821
bool Disconnect() override
Disconnect from device.
const char * getDefaultName() override
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
void IDMessage(const char *dev, const char *fmt,...)
Definition: indidriver.c:960
std::unique_ptr< SimpleDevice > simpleDevice(new SimpleDevice())
Construct a basic INDI device with only one property to connect and disconnect.