mirror of
https://github.com/ShaYmez/NXDNClients.git
synced 2025-02-03 09:44:25 -05: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
|
||||
len = localNetwork.read(buffer, address, port);
|
||||
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;
|
||||
|
||||
srcId = (buffer[8U] << 8) & 0xFF00U;
|
||||
@ -314,6 +315,12 @@ void CNXDNGateway::run()
|
||||
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
|
||||
|
@ -255,9 +255,6 @@ void CVoice::createVoice(unsigned int tg, const std::vector<std::string>& words)
|
||||
createTrailer(true, tg);
|
||||
|
||||
delete[] ambeData;
|
||||
|
||||
m_status = VS_WAITING;
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
unsigned int CVoice::read(unsigned char* data)
|
||||
@ -288,11 +285,14 @@ unsigned int CVoice::read(unsigned char* data)
|
||||
return 0U;
|
||||
}
|
||||
|
||||
void CVoice::abort()
|
||||
void CVoice::eof()
|
||||
{
|
||||
m_status = VS_NONE;
|
||||
m_voiceLength = 0U;
|
||||
m_sent = 0U;
|
||||
if (m_voiceLength == 0U)
|
||||
return;
|
||||
|
||||
m_status = VS_WAITING;
|
||||
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
void CVoice::clock(unsigned int ms)
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
|
||||
unsigned int read(unsigned char* data);
|
||||
|
||||
void abort();
|
||||
void eof();
|
||||
|
||||
void clock(unsigned int ms);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user