minor improve of ProcessMMDVM

pull/12/head
Tom Early 7 years ago
parent a998aae5b2
commit 4da5f4e7a4

@ -280,8 +280,7 @@ bool CQnetRelay::ProcessGateway(const int len, const unsigned char *raw)
bool CQnetRelay::ProcessMMDVM(const int len, const unsigned char *raw) bool CQnetRelay::ProcessMMDVM(const int len, const unsigned char *raw)
{ {
static short old_id = 0U; static short id = 0U;
static short stream_id = 0U;
SDSRP dsrp; SDSRP dsrp;
if (len < 65) if (len < 65)
::memcpy(dsrp.title, raw, len); // transfer raw data to SDSRP struct ::memcpy(dsrp.title, raw, len); // transfer raw data to SDSRP struct
@ -289,10 +288,12 @@ bool CQnetRelay::ProcessMMDVM(const int len, const unsigned char *raw)
if (49==len || 21==len) { if (49==len || 21==len) {
// grab the stream id if this is a header // grab the stream id if this is a header
if (49 == len) { if (49 == len) {
stream_id = dsrp.header.id; if (dsrp.header.id == id)
if (old_id == stream_id) return false;
id = dsrp.header.id;
} else {
if (dsrp.voice.id != id)
return false; return false;
old_id = stream_id;
} }
SDSTR dstr; // destination SDSTR dstr; // destination
@ -306,7 +307,7 @@ bool CQnetRelay::ProcessMMDVM(const int len, const unsigned char *raw)
dstr.vpkt.dst_rptr_id = 0x0; dstr.vpkt.dst_rptr_id = 0x0;
dstr.vpkt.snd_rptr_id = 0x1; dstr.vpkt.snd_rptr_id = 0x1;
dstr.vpkt.snd_term_id = ('B'==RPTR_MOD) ? 0x1 : (('C'==RPTR_MOD) ? 0x2 : 0x3); dstr.vpkt.snd_term_id = ('B'==RPTR_MOD) ? 0x1 : (('C'==RPTR_MOD) ? 0x2 : 0x3);
dstr.vpkt.streamid = stream_id; dstr.vpkt.streamid = id;
if (49 == len) { // header if (49 == len) { // header
dstr.remaining = 0x30; dstr.remaining = 0x30;

Loading…
Cancel
Save

Powered by TurnKey Linux.