]> git.vomp.tv Git - vompclient.git/blob - src/telem.h
Created basic telemetry system
[vompclient.git] / src / telem.h
1 /*
2     Copyright 2024 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
18 */
19
20 #ifndef TELEM_H
21 #define TELEM_H
22
23 #define TELEM_ENABLED 1
24
25 #include "defines.h"
26
27 #include "udp4.h"
28
29
30 class Telemetry
31 {
32   public:
33     static void init();
34     static void message(u4 messageNumber, i4 data);
35     static void message(u4 messageNumber, i8 data);
36     static void message(u4 messageNumber, u8 data);
37
38   private:
39     static UDP4 udp;
40 };
41
42 #if TELEM_ENABLED
43   #define TELEM(x, y) Telemetry::message(x, y)
44 #else
45   #define TELEM(x, y)
46 #endif
47
48
49
50 #endif