Instrument Neutral Distributed Interface INDI 2.2.5
simpledevice.cpp
Go to the documentation of this file.
1/*
2 INDI Developers Manual
3 Tutorial #1
4
5 "Hello INDI"
6
7 We construct a most basic (and useless) device driver to illustrate INDI.
8
9 Refer to README, which contains instruction on how to build this driver, and use it
10 with an INDI-compatible client.
11
12*/
13
22#include "simpledevice.h"
23
24#include <memory>
25
26std::unique_ptr<SimpleDevice> simpleDevice(new SimpleDevice());
27
28/**************************************************************************************
29** Client is asking us to establish connection to the device
30***************************************************************************************/
32{
33 LOG_INFO("Simple device connected successfully!");
34 return true;
35}
36
37/**************************************************************************************
38** Client is asking us to terminate connection to the device
39***************************************************************************************/
41{
42 LOG_INFO("Simple device disconnected successfully!");
43 return true;
44}
45
46/**************************************************************************************
47** INDI is asking us for our default device name
48***************************************************************************************/
50{
51 return "Simple Device";
52}
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...
#define LOG_INFO(txt)
Definition indilogger.h:74
std::unique_ptr< SimpleDevice > simpleDevice(new SimpleDevice())
Construct a basic INDI device with only one property to connect and disconnect.