clean up aprs and slow data

lastudp
Tom Early 7 years ago
parent 911e829a3f
commit 5f16de827c

@ -823,7 +823,7 @@ void CQnetGateway::ProcessTimeouts()
// the to_print is an integer that counts down how many 2-voice-frame pairs remain to be processed. // the to_print is an integer that counts down how many 2-voice-frame pairs remain to be processed.
// ABC_grp means that we are processing a 20-character message. // ABC_grp means that we are processing a 20-character message.
// C_seen means that we are processing the last 2-voice-frame packet on a 20 character message. // C_seen means that we are processing the last 2-voice-frame packet on a 20 character message.
void CQnetGateway::ProcessSlowData(unsigned char *data, unsigned short sid, unsigned char &header_type, bool *new_group, short *to_print, bool *ABC_grp, bool *C_seen) void CQnetGateway::ProcessSlowData(unsigned char *data, unsigned short sid)
{ {
/* extract 20-byte RADIO ID */ /* extract 20-byte RADIO ID */
if ((data[0] != 0x55) || (data[1] != 0x2d) || (data[2] != 0x16)) { if ((data[0] != 0x55) || (data[1] != 0x2d) || (data[2] != 0x16)) {
@ -1134,13 +1134,6 @@ void CQnetGateway::Process()
int dtmf_last_frame[3] = { 0, 0, 0 }; int dtmf_last_frame[3] = { 0, 0, 0 };
unsigned int dtmf_counter[3] = { 0, 0, 0 }; unsigned int dtmf_counter[3] = { 0, 0, 0 };
// text stuff
bool new_group[3] = { true, true, true };
unsigned char header_type = 0;
short to_print[3] = { 0, 0, 0 };
bool ABC_grp[3] = { false, false, false };
bool C_seen[3] = { false, false, false };
dstar_dv_init(); dstar_dv_init();
int max_nfds = 0; int max_nfds = 0;
@ -1997,17 +1990,17 @@ void CQnetGateway::Process()
} }
vPacketCount++; vPacketCount++;
if (recvlen == 29) // process the slow data from every voice packet if (recvlen == 29) // process the slow data from every voice packet
ProcessSlowData(rptrbuf.vpkt.vasd.text, rptrbuf.vpkt.streamid, header_type, new_group, to_print, ABC_grp, C_seen); ProcessSlowData(rptrbuf.vpkt.vasd.text, rptrbuf.vpkt.streamid);
else else
ProcessSlowData(rptrbuf.vpkt.vasd1.text, rptrbuf.vpkt.streamid, header_type, new_group, to_print, ABC_grp, C_seen); ProcessSlowData(rptrbuf.vpkt.vasd1.text, rptrbuf.vpkt.streamid);
/* send data to qnlink */ /* send data to qnlink */
sendto(srv_sock, rptrbuf.pkt_id, recvlen, 0, (struct sockaddr *)&plug, sizeof(struct sockaddr_in)); sendto(srv_sock, rptrbuf.pkt_id, recvlen, 0, (struct sockaddr *)&plug, sizeof(struct sockaddr_in));
/* aprs processing */ /* aprs processing */
if (bool_send_aprs) if (bool_send_aprs)
// streamID seq audio+text size // streamID seq audio+text
aprs->ProcessText(ntohs(rptrbuf.vpkt.streamid), rptrbuf.vpkt.ctrl, rptrbuf.vpkt.vasd.voice, (recvlen == 29)?12:15); aprs->ProcessText(ntohs(rptrbuf.vpkt.streamid), rptrbuf.vpkt.ctrl, rptrbuf.vpkt.vasd.voice);
for (int i=0; i<3; i++) { for (int i=0; i<3; i++) {
/* find out if data must go to the remote G2 */ /* find out if data must go to the remote G2 */

@ -83,13 +83,19 @@ public:
int Init(char *cfgfile); int Init(char *cfgfile);
private: private:
bool is_icom, is_not_icom; // text stuff
bool new_group[3] = { true, true, true };
unsigned char header_type = 0;
short to_print[3] = { 0, 0, 0 };
bool ABC_grp[3] = { false, false, false };
bool C_seen[3] = { false, false, false };
SPORTIP g2_internal, g2_external, g2_link, ircddb; SPORTIP g2_internal, g2_external, g2_link, ircddb;
std::string OWNER, owner, local_irc_ip, status_file, dtmf_dir, dtmf_file, echotest_dir, irc_pass, qnvoicefile; std::string OWNER, owner, local_irc_ip, status_file, dtmf_dir, dtmf_file, echotest_dir, irc_pass, qnvoicefile;
bool bool_send_qrgs, bool_irc_debug, bool_dtmf_debug, bool_regen_header, bool_qso_details, bool_send_aprs, playNotInCache; bool bool_send_qrgs, bool_irc_debug, bool_dtmf_debug, bool_regen_header, bool_qso_details, bool_send_aprs, playNotInCache;
bool is_icom, is_not_icom;
int play_wait, play_delay, echotest_rec_timeout, voicemail_rec_timeout, from_remote_g2_timeout, from_local_rptr_timeout, dtmf_digit; int play_wait, play_delay, echotest_rec_timeout, voicemail_rec_timeout, from_remote_g2_timeout, from_local_rptr_timeout, dtmf_digit;
@ -154,7 +160,7 @@ private:
void compute_aprs_hash(); void compute_aprs_hash();
void APRSBeaconThread(); void APRSBeaconThread();
void ProcessTimeouts(); void ProcessTimeouts();
void ProcessSlowData(unsigned char *data, unsigned short sid, unsigned char &header_type, bool *new_group, short *to_print, bool *ABC_grp, bool *C_seen); void ProcessSlowData(unsigned char *data, unsigned short sid);
bool Flag_is_ok(unsigned char flag); bool Flag_is_ok(unsigned char flag);
// read configuration file // read configuration file

@ -52,7 +52,7 @@ void CAPRS::SelectBand(short int rptr_idx, unsigned short streamID)
// Parameter len is either 12 or 15, because we took passed over the first 17 bytes // Parameter len is either 12 or 15, because we took passed over the first 17 bytes
// in the repeater data // in the repeater data
// Paramter seq is the byte at pos# 16(counting from zero) in the repeater data // Paramter seq is the byte at pos# 16(counting from zero) in the repeater data
void CAPRS::ProcessText(unsigned short streamID, unsigned char seq, unsigned char *buf, unsigned int len) void CAPRS::ProcessText(unsigned short streamID, unsigned char seq, unsigned char *buf)
{ {
unsigned char aprs_data[200]; unsigned char aprs_data[200];
char aprs_buf[1024]; char aprs_buf[1024];
@ -60,8 +60,6 @@ void CAPRS::ProcessText(unsigned short streamID, unsigned char seq, unsigned cha
short int rptr_idx = -1; short int rptr_idx = -1;
len = len;
for (short int i = 0; i < 3; i++) { for (short int i = 0; i < 3; i++) {
if (streamID == aprs_streamID[i].streamID) { if (streamID == aprs_streamID[i].streamID) {
rptr_idx = i; rptr_idx = i;

@ -58,7 +58,7 @@ public:
~CAPRS(); ~CAPRS();
SRPTR *m_rptr; SRPTR *m_rptr;
void SelectBand(short int rptr_idx, unsigned short streamID); void SelectBand(short int rptr_idx, unsigned short streamID);
void ProcessText(unsigned short streamID, unsigned char seq, unsigned char *buf, unsigned int len); void ProcessText(unsigned short streamID, unsigned char seq, unsigned char *buf);
ssize_t WriteSock(char *buffer, size_t n); ssize_t WriteSock(char *buffer, size_t n);
void Open(const std::string OWNER); void Open(const std::string OWNER);
void Init(); void Init();

@ -1,5 +1,5 @@
// version strings must be 55 characters or less! // version strings must be 55 characters or less!
#define IRCDDB_VERSION "QnetGateway-7.4.3" #define IRCDDB_VERSION "QnetGateway-7.4.4"
#define LINK_VERSION "QnetLink-6.2.0" #define LINK_VERSION "QnetLink-6.2.0"
#define DVAP_VERSION "QnetDVAP-5.1.2" #define DVAP_VERSION "QnetDVAP-5.1.2"
#define RELAY_VERSION "QnetRelay-0.2.3" #define RELAY_VERSION "QnetRelay-0.2.3"

Loading…
Cancel
Save

Powered by TurnKey Linux.