libpandac  0.0.0
A library designed for a comm.ai Panda.
panda.h
1 /*
2  Author: Matt Bunting
3  Copyright (c) 2020 Arizona Board of Regents
4  All rights reserved.
5 
6  Permission is hereby granted, without written agreement and without
7  license or royalty fees, to use, copy, modify, and distribute this
8  software and its documentation for any purpose, provided that the
9  above copyright notice and the following two paragraphs appear in
10  all copies of this software.
11 
12  IN NO EVENT SHALL THE ARIZONA BOARD OF REGENTS BE LIABLE TO ANY PARTY
13  FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14  ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15  IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
16  SUCH DAMAGE.
17 
18  THE ARIZONA BOARD OF REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
19  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20  AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER
21  IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION
22  TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23 
24  */
25 
26 #ifndef PANDA_HANDLER_H
27 #define PANDA_HANDLER_H
28 
29 #include "panda/usb.h"
30 #include "panda/can.h"
31 #include "panda/gps.h"
32 #include "panda/gpsTime.h"
33 #include "panda/obd-pid.h"
34 
39 namespace Panda {
40 
50  class Handler {
51  public:
52  Handler();
53  ~Handler();
54 
57  void initialize();
58 
62  void stop();
63 
67  void addCanObserver( CanListener& can );
68 
72  void addGpsObserver( GpsListener& gps );
73 
77  void addUsbObserver( UsbListener& usb );
78 
82  Can& getCan();
83 
87  Gps& getGps();
88 
92  Usb& getUsb();
93 
94  private:
95  Usb mUsb;
96  Can mCan;
97  Gps mGps;
98  };
99 }
100 
101 #endif
void addCanObserver(CanListener &can)
Add listeners to CAN packet updates.
A class that handles the Usb, GPS, and CAN data.
Definition: panda.h:50
Handles USB communication and parsing with a comma.ai Panda.
Definition: can.h:38
void addGpsObserver(GpsListener &gps)
Add listeners to GPS data updates.
An abstract class for new data notifications for new CAN data.
Definition: can.h:63
void initialize()
Start up USB, GPS, and decoding threads.
void stop()
Stop USB, GPS, and decoding threads This should be called after initialize() when done with data coll...
Gps & getGps()
Returns the in-use GPS parser.
A class that handles the GPS data.
Definition: gps.h:74
void addUsbObserver(UsbListener &usb)
Add listeners to USB data updates.
Can & getCan()
Returns the in-use CAN parser.
Usb & getUsb()
Returns the in-use USB handler.
Definition: usb.h:80
Definition: usb.h:60
An abstract class for new data notifications for new GPS data.
Definition: gps.h:50
A class that handles the CAN data.
Definition: can.h:103