Instrument Neutral Distributed Interface INDI 2.2.5
defaultdevice_p.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2011 Jasem Mutlaq. All rights reserved.
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*******************************************************************************/
18
19#pragma once
20
21#include "parentdevice_p.h"
22#include "defaultdevice.h"
23#include "watchdeviceproperty.h"
24
25#include <cstring>
26#include <list>
27#include <mutex>
28#include <string>
29
30#include "indipropertyswitch.h"
31#include "indipropertynumber.h"
32#include "indipropertytext.h"
33#include "inditimer.h"
34
35namespace INDI
36{
38{
39 public:
41 virtual ~DefaultDevicePrivate();
42
44
45 bool isInit { false };
46 bool isDebug { false };
47 bool isSimulation { false };
49 bool isConfigLoading { false };
50
51 uint16_t majorVersion { 1 };
52 uint16_t minorVersion { 0 };
54
61 PropertySwitch ConnectionModeSP { 0 }; // dynamic count of switches
63
64 std::vector<Connection::Interface *> connections;
66
70 uint32_t pollingPeriod = 1000;
71
74
75 // TimerHit timer
77
78 public:
79 static std::list<DefaultDevicePrivate*> devices;
80 static std::recursive_mutex devicesLock;
81
83
84 int loadINDINicknamesXML(const char *devicename);
85 int saveINDINicknamesXML(const char *devicename);
86
87 bool nicknamesLoaded{false};
88 std::string deviceNickname{};
89 std::map<std::string, std::string> nicknameMap{};
90};
91
92}
The Interface class is the base class for all INDI connection plugins.
int loadINDINicknamesXML(const char *devicename)
int saveINDINicknamesXML(const char *devicename)
Save Nickname data to XML.
static std::list< DefaultDevicePrivate * > devices
static std::recursive_mutex devicesLock
Connection::Interface * activeConnection
WatchDeviceProperty watchDevice
std::vector< Connection::Interface * > connections
uint32_t pollingPeriod
pollingPeriod Period in milliseconds to call TimerHit(). Default 1000 ms
std::map< std::string, std::string > nicknameMap
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
The Timer class provides repetitive and single-shot timers.
Definition inditimer.h:41
Namespace to encapsulate INDI client, drivers, and mediator classes.