NMT: Disable Supervisory signal during DMS (SMS) transfer and use Timeout

There is no Supervisory signal during DMS transfer, so there must be
no timeout for Supervisory signal. Instead, the SMS layer will timeout
after some seconds without receiving data.
This commit is contained in:
Andreas Eversberg 2017-06-11 08:13:52 +02:00
parent 3e86ef95c4
commit 7a9762e28e
2 changed files with 9 additions and 2 deletions

View File

@ -924,7 +924,7 @@ static void tx_mo_complete(nmt_t *nmt, frame_t *frame)
nmt_new_state(nmt, STATE_ACTIVE);
nmt->active_state = ACTIVE_STATE_VOICE;
nmt_set_dsp_mode(nmt, DSP_MODE_AUDIO);
if (nmt->supervisory) {
if (nmt->supervisory && !nmt->dms_call) {
super_reset(nmt);
timer_start(&nmt->timer, SUPERVISORY_TO1);
}
@ -1179,7 +1179,7 @@ static void tx_mt_complete(nmt_t *nmt, frame_t *frame)
nmt_new_state(nmt, STATE_ACTIVE);
nmt->active_state = ACTIVE_STATE_VOICE;
nmt_set_dsp_mode(nmt, DSP_MODE_AUDIO);
if (nmt->supervisory) {
if (nmt->supervisory && !nmt->dms_call) {
super_reset(nmt);
timer_start(&nmt->timer, SUPERVISORY_TO1);
}

View File

@ -28,6 +28,7 @@
#include "../common/timer.h"
#include "nmt.h"
#define SMS_RECEIVE_TO 5.0
#define SMS_RELEASE_TO 2.0
/* TP-Message-Type-Indicator (TP-MTI) */
@ -331,6 +332,9 @@ int sms_deliver(nmt_t *nmt, uint8_t ref, const char *orig_address, uint8_t orig_
nmt->sms.mt = 1;
dms_send(nmt, data, length, 1);
/* start timer */
timer_start(&nmt->sms_timer, SMS_RECEIVE_TO);
return 0;
}
@ -596,6 +600,9 @@ void dms_receive(nmt_t *nmt, const uint8_t *data, int length, int __attribute__(
sprintf(debug_text + i * 5, " 0x%02x", data[i]);
debug_text[length * 5] = '\0';
/* restart timer */
timer_start(&nmt->sms_timer, SMS_RECEIVE_TO);
PDEBUG(DSMS, DEBUG_DEBUG, "Received %d bytes from DMS layer:%s\n", length, debug_text);
if (sms->mt && !sms->data_sent) {