Instrument Neutral Distributed Interface INDI  1.9.5
wunderground.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright(c) 2015 Jasem Mutlaq. All rights reserved.
3 
4  INDI Weather Underground (TM) Weather Driver
5 
6  This program is free software; you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by the Free
8  Software Foundation; either version 2 of the License, or (at your option)
9  any later version.
10 
11  This program is distributed in the hope that it will be useful, but WITHOUT
12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 
21  The full GNU General Public License is included in this distribution in the
22  file called LICENSE.
23 *******************************************************************************/
24 
25 #pragma once
26 
27 #include "indiweather.h"
28 
30 {
31  public:
32  WunderGround();
33  virtual ~WunderGround();
34 
35  // Generic indi device entries
36  bool Connect();
37  bool Disconnect();
38  const char *getDefaultName();
39 
40  virtual bool initProperties() override;
41  virtual void ISGetProperties(const char *dev) override;
42  virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
43 
44  protected:
45  virtual IPState updateWeather();
46 
47  virtual bool saveConfigItems(FILE *fp);
48  virtual bool updateLocation(double latitude, double longitude, double elevation);
49 
50  private:
51  IText wunderAPIKeyT[1] {};
52  ITextVectorProperty wunderAPIKeyTP;
53 
54  double wunderLat, wunderLong;
55 };
WunderGround::~WunderGround
virtual ~WunderGround()
Definition: wunderground.cpp:54
WunderGround::initProperties
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: wunderground.cpp:80
WunderGround::ISGetProperties
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
Definition: wunderground.cpp:104
IPState
IPState
Property state.
Definition: indiapi.h:158
WunderGround::Disconnect
bool Disconnect()
Disconnect from device.
Definition: wunderground.cpp:75
INDI::Weather
Definition: indiweather.h:68
WunderGround::WunderGround
WunderGround()
Definition: wunderground.cpp:44
_ITextVectorProperty
Text vector property descriptor.
Definition: indiapi.h:244
WunderGround::getDefaultName
const char * getDefaultName()
Definition: wunderground.cpp:58
IText
One text descriptor.
WunderGround::updateLocation
virtual bool updateLocation(double latitude, double longitude, double elevation)
Update weather station location.
Definition: wunderground.cpp:129
WunderGround::ISNewText
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
Definition: wunderground.cpp:113
WunderGround
Definition: wunderground.h:29
name
const char * name
Definition: indiserver.c:116
WunderGround::saveConfigItems
virtual bool saveConfigItems(FILE *fp)
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
Definition: wunderground.cpp:247
indiweather.h
WunderGround::updateWeather
virtual IPState updateWeather()
updateWeather Update weather conditions from device or service. The function should not change the st...
Definition: wunderground.cpp:139
WunderGround::Connect
bool Connect()
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
Definition: wunderground.cpp:63