Instrument Neutral Distributed Interface INDI  1.9.2
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 "basedevice_p.h"
22 #include "defaultdevice.h"
23 
24 #include <cstring>
25 #include <list>
26 #include <mutex>
27 
28 #include "indipropertyswitch.h"
29 #include "indipropertynumber.h"
30 #include "indipropertytext.h"
31 #include "inditimer.h"
32 
33 namespace INDI
34 {
35 class DefaultDevicePrivate: public BaseDevicePrivate
36 {
37  public:
38  DefaultDevicePrivate(DefaultDevice *defaultDevice);
39  virtual ~DefaultDevicePrivate();
40 
41  DefaultDevice *defaultDevice;
42 
43  bool isInit { false };
44  bool isDebug { false };
45  bool isSimulation { false };
46  bool isDefaultConfigLoaded {false};
47  bool isConfigLoading { false };
48 
49  uint16_t majorVersion { 1 };
50  uint16_t minorVersion { 0 };
51  uint16_t interfaceDescriptor { 0 };
52  int m_ConfigConnectionMode {-1};
53 
54  PropertySwitch SimulationSP { 2 };
55  PropertySwitch DebugSP { 2 };
56  PropertySwitch ConfigProcessSP { 4 };
57  PropertySwitch ConnectionSP { 2 };
58  PropertyNumber PollPeriodNP { 1 };
59  PropertyText DriverInfoTP { 4 };
60  PropertySwitch ConnectionModeSP { 0 }; // dynamic count of switches
61 
62  std::vector<Connection::Interface *> connections;
64 
68  uint32_t pollingPeriod = 1000;
69 
70  bool defineDynamicProperties {true};
71  bool deleteDynamicProperties {true};
72 
73  // TimerHit timer
75 
76  public:
77  static std::list<DefaultDevicePrivate*> devices;
78  static std::recursive_mutex devicesLock;
79 };
80 
81 }
indipropertytext.h
indipropertynumber.h
INDI::DefaultDevicePrivate::DebugSP
PropertySwitch DebugSP
Definition: defaultdevice_p.h:87
INDI::DefaultDevicePrivate::defaultDevice
DefaultDevice * defaultDevice
Definition: defaultdevice_p.h:73
indipropertyswitch.h
inditimer.h
INDI::DefaultDevicePrivate::m_ConfigConnectionMode
int m_ConfigConnectionMode
Definition: defaultdevice_p.h:84
INDI::DefaultDevicePrivate::isInit
bool isInit
Definition: defaultdevice_p.h:75
INDI::DefaultDevicePrivate::ConfigProcessSP
PropertySwitch ConfigProcessSP
Definition: defaultdevice_p.h:88
INDI::DefaultDevicePrivate::devicesLock
static std::recursive_mutex devicesLock
Definition: defaultdevice_p.h:110
INDI::Timer
The Timer class provides repetitive and single-shot timers.
Definition: inditimer.h:40
INDI::DefaultDevicePrivate::minorVersion
uint16_t minorVersion
Definition: defaultdevice_p.h:82
INDI::DefaultDevicePrivate::ConnectionModeSP
PropertySwitch ConnectionModeSP
Definition: defaultdevice_p.h:92
INDI::DefaultDevicePrivate::majorVersion
uint16_t majorVersion
Definition: defaultdevice_p.h:81
INDI::DefaultDevicePrivate::devices
static std::list< DefaultDevicePrivate * > devices
Definition: defaultdevice_p.h:109
INDI::DefaultDevicePrivate::connections
std::vector< Connection::Interface * > connections
Definition: defaultdevice_p.h:94
INDI::DefaultDevicePrivate::isSimulation
bool isSimulation
Definition: defaultdevice_p.h:77
INDI::DefaultDevicePrivate::isDefaultConfigLoaded
bool isDefaultConfigLoaded
Definition: defaultdevice_p.h:78
INDI::DefaultDevicePrivate::defineDynamicProperties
bool defineDynamicProperties
Definition: defaultdevice_p.h:102
INDI::DefaultDevicePrivate::~DefaultDevicePrivate
virtual ~DefaultDevicePrivate()
Definition: defaultdevice.cpp:128
defaultdevice.h
INDI::DefaultDevicePrivate::ConnectionSP
PropertySwitch ConnectionSP
Definition: defaultdevice_p.h:89
INDI::DefaultDevicePrivate::isConfigLoading
bool isConfigLoading
Definition: defaultdevice_p.h:79
INDI::DefaultDevicePrivate::PollPeriodNP
PropertyNumber PollPeriodNP
Definition: defaultdevice_p.h:90
INDI::DefaultDevicePrivate::DefaultDevicePrivate
DefaultDevicePrivate(DefaultDevice *defaultDevice)
Definition: defaultdevice.cpp:121
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
INDI::DefaultDevicePrivate::SimulationSP
PropertySwitch SimulationSP
Definition: defaultdevice_p.h:86
INDI::DefaultDevicePrivate::pollingPeriod
uint32_t pollingPeriod
pollingPeriod Period in milliseconds to call TimerHit(). Default 1000 ms
Definition: defaultdevice_p.h:100
INDI::DefaultDevicePrivate::activeConnection
Connection::Interface * activeConnection
Definition: defaultdevice_p.h:95
Connection::Interface
The Interface class is the base class for all INDI connection plugins.
Definition: connectioninterface.h:51
INDI::DefaultDevicePrivate::interfaceDescriptor
uint16_t interfaceDescriptor
Definition: defaultdevice_p.h:83
basedevice_p.h
INDI::DefaultDevicePrivate::m_MainLoopTimer
INDI::Timer m_MainLoopTimer
Definition: defaultdevice_p.h:106
INDI::DefaultDevicePrivate::isDebug
bool isDebug
Definition: defaultdevice_p.h:76
INDI::DefaultDevicePrivate::deleteDynamicProperties
bool deleteDynamicProperties
Definition: defaultdevice_p.h:103
INDI::DefaultDevicePrivate::DriverInfoTP
PropertyText DriverInfoTP
Definition: defaultdevice_p.h:91