SoDaRadio-5.0.3-master:8901fb5
GPSmon.hxx
Go to the documentation of this file.
1 /*
2 Copyright (c) 2012,2017 Matthew H. Reilly (kb1vc)
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are
7 met:
8 
9  Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11  Redistributions in binary form must reproduce the above copyright
12  notice, this list of conditions and the following disclaimer in
13  the documentation and/or other materials provided with the
14  distribution.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28 
29 #ifndef GPS_MON_HDR
30 #define GPS_MON_HDR
31 #include "SoDaBase.hxx"
32 #include "MultiMBox.hxx"
33 #include "Command.hxx"
34 #include "Params.hxx"
35 #include "UI.hxx"
36 
37 #ifdef HAVE_GPSLIB
38 #include <gps.h>
39 #endif
40 
41 #include <time.h>
42 #include <sys/time.h>
43 
44 namespace SoDa {
45  class GPSmon : public SoDaThread {
46  public:
47  GPSmon(Params * params, CmdMBox * cmd_stream);
48  void run();
49  private:
50  void execGetCommand(Command * cmd);
51  void execSetCommand(Command * cmd);
52  void execRepCommand(Command * cmd);
53 
55  unsigned int cmd_subs;
56 #if HAVE_GPSLIB
57  // gpsd lib
58  struct gps_data_t gps_data;
59 #endif
61 
62  };
63 }
64 
65 
66 #endif
The Baseclass for all SoDa objects, and useful commonly used classes.
The Thread baseclass for all SoDa thread objects.
Definition: SoDaBase.hxx:284
void execGetCommand(Command *cmd)
optional method to handle "GET" commands – commands that request a response
Definition: GPSmon.cxx:109
unsigned int cmd_subs
Definition: GPSmon.hxx:55
void execSetCommand(Command *cmd)
optional method to handle "SET" commands – commands that set internal state in the object...
Definition: GPSmon.cxx:115
This class handles command line parameters and built-ins.
Definition: Params.hxx:42
void run()
Each thread object must define its "run" loop.
Definition: GPSmon.cxx:57
GPSmon(Params *params, CmdMBox *cmd_stream)
Definition: GPSmon.cxx:33
This is a list of all the commands that can "do something" to one or more components in the SoDa radi...
Definition: Command.hxx:47
CmdMBox * cmd_stream
Definition: GPSmon.hxx:54
bool gps_server_ready
Definition: GPSmon.hxx:60
void execRepCommand(Command *cmd)
optional method that reports status or the result of some action.
Definition: GPSmon.cxx:121