Instrument Neutral Distributed Interface INDI 2.2.5
LocalDrvInfo.hpp
Go to the documentation of this file.
1/* INDI Server for protocol version 1.7.
2 * Copyright (C) 2007 Elwood C. Downey <[email protected]>
3 2013 Jasem Mutlaq <[email protected]>
4 2022 Ludovic Pollet
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18*/
19#pragma once
20
21#include "DvrInfo.hpp"
22
23#include <ev++.h>
24#include <string>
25
26class LocalDvrInfo: public DvrInfo
27{
28 char errbuff[1024]; /* buffer for stderr pipe. line too long will be clipped */
29 int errbuffpos = 0; /* first free pos in buffer */
30 ev::io eio; /* Event loop io events */
31 ev::child pidwatcher;
32 void onEfdEvent(ev::io &watcher, int revents); /* callback for data on efd */
33 void onPidEvent(ev::child &watcher, int revents);
34
35 int pid = 0; /* process id or 0 for N/A (not started/terminated) */
36 int efd = -1; /* stderr from driver, or -1 when N/A */
37
38 void closeEfd();
39 void closePid();
40 protected:
41 LocalDvrInfo(const LocalDvrInfo &model);
42
43 public:
44 std::string envDev;
45 std::string envConfig;
46 std::string envSkel;
47 std::string envPrefix;
48
50 virtual ~LocalDvrInfo();
51
52 void start() override;
53
54 LocalDvrInfo * clone() const override;
55
56 const std::string remoteServerUid() const override
57 {
58 return "";
59 }
60};
std::string envPrefix
std::string envConfig
std::string envSkel
const std::string remoteServerUid() const override
void start() override
virtual ~LocalDvrInfo()
std::string envDev
LocalDvrInfo * clone() const override