-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathm17codec.h
executable file
·52 lines (45 loc) · 1.53 KB
/
m17codec.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Copyright (C) 2019-2021 Doug McLain
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef M17CODEC_H
#define M17CODEC_H
#include <string>
#include "codec.h"
#include "codec2/codec2.h"
class M17Codec : public Codec
{
Q_OBJECT
public:
M17Codec(QString callsign, char module, QString hostname, QString host, int port, bool ipv6, QString modem, QString audioin, QString audioout);
~M17Codec();
static void encode_callsign(uint8_t *);
static void decode_callsign(uint8_t *);
void decode_c2(int16_t *, uint8_t *);
void encode_c2(int16_t *, uint8_t *);
void set_mode(bool m){ m_c2->codec2_set_mode(m);}
bool get_mode(){ return m_c2->codec2_get_mode(); }
CCodec2 *m_c2;
private slots:
void process_udp();
void send_ping();
void send_disconnect();
void decoder_gain_changed(qreal);
void start_tx();
void transmit();
void hostname_lookup(QHostInfo i);
void rate_changed(int r) { m_txrate = r; }
void process_rx_data();
private:
int m_txrate;
};
#endif // M17CODEC_H