mirror of
https://github.com/ShaYmez/NXDNClients.git
synced 2024-09-27 14:46:34 -04:00
Start the voice timer after the end of the transmission.
This commit is contained in:
parent
ca206115ff
commit
74f3674cff
@ -258,7 +258,8 @@ void CNXDNGateway::run()
|
|||||||
// From the MMDVM to the reflector or control data
|
// From the MMDVM to the reflector or control data
|
||||||
len = localNetwork.read(buffer, address, port);
|
len = localNetwork.read(buffer, address, port);
|
||||||
if (len > 0U) {
|
if (len > 0U) {
|
||||||
if (buffer[0U] == 0x81U || buffer[0U] == 0x83U) {
|
// Only process the beginning and ending blocks here
|
||||||
|
if ((buffer[0U] == 0x81U || buffer[0U] == 0x83U) && (buffer[5U] == 0x01U || buffer[5U] == 0x08U)) {
|
||||||
grp = (buffer[7U] & 0x20U) == 0x20U;
|
grp = (buffer[7U] & 0x20U) == 0x20U;
|
||||||
|
|
||||||
srcId = (buffer[8U] << 8) & 0xFF00U;
|
srcId = (buffer[8U] << 8) & 0xFF00U;
|
||||||
@ -314,6 +315,12 @@ void CNXDNGateway::run()
|
|||||||
lostTimer.start();
|
lostTimer.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If it's the end of the transmission, start the voice
|
||||||
|
if (buffer[5U] == 0x08U) {
|
||||||
|
if (voice != NULL)
|
||||||
|
voice->eof();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're linked and we have a network, send it on
|
// If we're linked and we have a network, send it on
|
||||||
|
@ -255,9 +255,6 @@ void CVoice::createVoice(unsigned int tg, const std::vector<std::string>& words)
|
|||||||
createTrailer(true, tg);
|
createTrailer(true, tg);
|
||||||
|
|
||||||
delete[] ambeData;
|
delete[] ambeData;
|
||||||
|
|
||||||
m_status = VS_WAITING;
|
|
||||||
m_timer.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int CVoice::read(unsigned char* data)
|
unsigned int CVoice::read(unsigned char* data)
|
||||||
@ -288,11 +285,14 @@ unsigned int CVoice::read(unsigned char* data)
|
|||||||
return 0U;
|
return 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVoice::abort()
|
void CVoice::eof()
|
||||||
{
|
{
|
||||||
m_status = VS_NONE;
|
if (m_voiceLength == 0U)
|
||||||
m_voiceLength = 0U;
|
return;
|
||||||
m_sent = 0U;
|
|
||||||
|
m_status = VS_WAITING;
|
||||||
|
|
||||||
|
m_timer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVoice::clock(unsigned int ms)
|
void CVoice::clock(unsigned int ms)
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
unsigned int read(unsigned char* data);
|
unsigned int read(unsigned char* data);
|
||||||
|
|
||||||
void abort();
|
void eof();
|
||||||
|
|
||||||
void clock(unsigned int ms);
|
void clock(unsigned int ms);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user