forked from nostar/DroidStar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nxdn.h
75 lines (66 loc) · 1.96 KB
/
nxdn.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
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 NXDN_H
#define NXDN_H
//#include <inttypes.h>
#include "mode.h"
class NXDN : public Mode
{
Q_OBJECT
public:
NXDN();
~NXDN();
uint8_t * get_frame();
uint8_t * get_eot(){m_eot = true; return get_frame();}
void set_hwtx(bool hw){m_hwtx = hw;}
private slots:
void process_udp();
void process_rx_data();
void get_ambe();
void send_ping(bool disconnect = false);
void send_disconnect() {send_ping(true);}
void transmit();
void hostname_lookup(QHostInfo i);
void send_frame();
private:
bool m_eot;
uint8_t m_nxdnframe[55];
uint8_t m_lich;
uint8_t m_sacch[5];
uint8_t m_layer3[22];
uint8_t m_ambe[36];
uint8_t packet_size;
void encode_header();
void encode_data();
uint8_t get_lich_fct(uint8_t);
void set_lich_rfct(uint8_t);
void set_lich_fct(uint8_t);
void set_lich_option(uint8_t);
void set_lich_dir(uint8_t);
void set_sacch_ran(uint8_t);
void set_sacch_struct(uint8_t);
void set_sacch_data(const uint8_t *);
void set_layer3_msgtype(uint8_t);
void set_layer3_srcid(uint16_t);
void set_layer3_dstid(uint16_t);
void set_layer3_grp(bool);
void set_layer3_blks(uint8_t);
void layer3_encode(uint8_t*, uint8_t, uint8_t);
uint8_t get_lich();
void get_sacch(uint8_t *);
void encode_crc6(uint8_t *, uint8_t);
void deinterleave_ambe(uint8_t *);
void interleave(uint8_t *ambe);
};
#endif // NXDN_H