B-Netz: Some cleanups
This commit is contained in:
@@ -32,9 +32,6 @@
|
|||||||
#include "telegramm.h"
|
#include "telegramm.h"
|
||||||
#include "dsp.h"
|
#include "dsp.h"
|
||||||
|
|
||||||
// Uncomment this to generate a dial sequnce (for testing)
|
|
||||||
//#define GEN_DIALSEQUENCE
|
|
||||||
|
|
||||||
/* Call reference for calls from mobile station to network
|
/* Call reference for calls from mobile station to network
|
||||||
This offset of 0x400000000 is required for MNCC interface. */
|
This offset of 0x400000000 is required for MNCC interface. */
|
||||||
static int new_callref = 0x40000000;
|
static int new_callref = 0x40000000;
|
||||||
@@ -284,12 +281,6 @@ static void bnetz_go_idle(bnetz_t *bnetz)
|
|||||||
bnetz_new_state(bnetz, BNETZ_FREI);
|
bnetz_new_state(bnetz, BNETZ_FREI);
|
||||||
bnetz_set_dsp_mode(bnetz, DSP_MODE_TELEGRAMM);
|
bnetz_set_dsp_mode(bnetz, DSP_MODE_TELEGRAMM);
|
||||||
switch_channel_19(bnetz, 0);
|
switch_channel_19(bnetz, 0);
|
||||||
#ifdef GEN_DIALSEQUENCE
|
|
||||||
if (bnetz->sender.loopback) {
|
|
||||||
bnetz_set_dsp_mode(bnetz, DSP_MODE_0);
|
|
||||||
timer_start(&bnetz->timer, 0.6);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release connection towards mobile station by sending release digits. */
|
/* Release connection towards mobile station by sending release digits. */
|
||||||
@@ -326,21 +317,10 @@ const char *bnetz_get_telegramm(bnetz_t *bnetz)
|
|||||||
struct impulstelegramm *it = NULL;
|
struct impulstelegramm *it = NULL;
|
||||||
|
|
||||||
if (bnetz->sender.loopback) {
|
if (bnetz->sender.loopback) {
|
||||||
#ifdef GEN_DIALSEQUENCE
|
|
||||||
char *dialstring="s50993310es50993310e", c;
|
|
||||||
c = dialstring[bnetz->loopback_count++];
|
|
||||||
if (c) {
|
|
||||||
it = bnetz_telegramm(c);
|
|
||||||
} else {
|
|
||||||
bnetz_set_dsp_mode(bnetz, DSP_MODE_SILENCE);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
bnetz->loopback_time[bnetz->loopback_count] = get_time();
|
bnetz->loopback_time[bnetz->loopback_count] = get_time();
|
||||||
it = bnetz_digit2telegramm(bnetz->loopback_count + '0');
|
it = bnetz_digit2telegramm(bnetz->loopback_count + '0');
|
||||||
if (++bnetz->loopback_count > 9)
|
if (++bnetz->loopback_count > 9)
|
||||||
bnetz->loopback_count = 0;
|
bnetz->loopback_count = 0;
|
||||||
#endif
|
|
||||||
} else
|
} else
|
||||||
switch(bnetz->state) {
|
switch(bnetz->state) {
|
||||||
case BNETZ_FREI:
|
case BNETZ_FREI:
|
||||||
@@ -490,7 +470,7 @@ void bnetz_receive_telegramm(bnetz_t *bnetz, uint16_t telegramm, double level_av
|
|||||||
case 'S':
|
case 'S':
|
||||||
bnetz->dial_type = DIAL_TYPE_METER;
|
bnetz->dial_type = DIAL_TYPE_METER;
|
||||||
break;
|
break;
|
||||||
case 'U':
|
case 'M':
|
||||||
bnetz->dial_type = DIAL_TYPE_METER_MUENZ;
|
bnetz->dial_type = DIAL_TYPE_METER_MUENZ;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -556,7 +536,7 @@ void bnetz_receive_telegramm(bnetz_t *bnetz, uint16_t telegramm, double level_av
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'U':
|
case 'M':
|
||||||
if (bnetz->dial_type != DIAL_TYPE_METER_MUENZ) {
|
if (bnetz->dial_type != DIAL_TYPE_METER_MUENZ) {
|
||||||
PDEBUG(DBNETZ, DEBUG_NOTICE, "Second received start message('Funkwahl') does not match first one (metering support, payphone), releaseing.\n");
|
PDEBUG(DBNETZ, DEBUG_NOTICE, "Second received start message('Funkwahl') does not match first one (metering support, payphone), releaseing.\n");
|
||||||
bnetz_release(bnetz, TRENN_COUNT);
|
bnetz_release(bnetz, TRENN_COUNT);
|
||||||
@@ -671,11 +651,6 @@ static void bnetz_timeout(struct timer *timer)
|
|||||||
bnetz_t *bnetz = (bnetz_t *)timer->priv;
|
bnetz_t *bnetz = (bnetz_t *)timer->priv;
|
||||||
|
|
||||||
switch (bnetz->state) {
|
switch (bnetz->state) {
|
||||||
#ifdef GEN_DIALSEQUENCE
|
|
||||||
case BNETZ_FREI:
|
|
||||||
bnetz_set_dsp_mode(bnetz, DSP_MODE_TELEGRAMM);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case BNETZ_WAHLABRUF:
|
case BNETZ_WAHLABRUF:
|
||||||
PDEBUG_CHAN(DBNETZ, DEBUG_NOTICE, "Timeout while receiving call setup from mobile station, releasing.\n");
|
PDEBUG_CHAN(DBNETZ, DEBUG_NOTICE, "Timeout while receiving call setup from mobile station, releasing.\n");
|
||||||
bnetz_release(bnetz, TRENN_COUNT);
|
bnetz_release(bnetz, TRENN_COUNT);
|
||||||
|
@@ -68,7 +68,7 @@ typedef struct bnetz {
|
|||||||
int callref; /* call reference */
|
int callref; /* call reference */
|
||||||
enum dial_mode dial_mode; /* sub state while dialing is received */
|
enum dial_mode dial_mode; /* sub state while dialing is received */
|
||||||
enum dial_type dial_type; /* defines if mobile supports metering pulses */
|
enum dial_type dial_type; /* defines if mobile supports metering pulses */
|
||||||
char dial_number[14]; /* dial string received */
|
char dial_number[14]; /* dial string received (13 digits + termination, first 0-digit not included) */
|
||||||
int dial_pos; /* current position while receiving digits */
|
int dial_pos; /* current position while receiving digits */
|
||||||
char station_id[6]; /* current station ID */
|
char station_id[6]; /* current station ID */
|
||||||
int station_id_pos; /* position while transmitting */
|
int station_id_pos; /* position while transmitting */
|
||||||
|
@@ -38,7 +38,7 @@ static struct impulstelegramm impulstelegramme[] = {
|
|||||||
/* Signale */
|
/* Signale */
|
||||||
{ 's', "0111001000100010", 0x0000, "Funkwahl ohne Gebuehrenuebermittlung" },
|
{ 's', "0111001000100010", 0x0000, "Funkwahl ohne Gebuehrenuebermittlung" },
|
||||||
{ 'S', "0111000100100100", 0x0000, "Funkwahl mit Gebuehrenuebermittlung" },
|
{ 'S', "0111000100100100", 0x0000, "Funkwahl mit Gebuehrenuebermittlung" },
|
||||||
{ 'U', "0111000010101000", 0x0000, "Funkwahl mit Gebuehrenuebermittlung (Muenzfernsprecher)" },
|
{ 'M', "0111000010101000", 0x0000, "Funkwahl mit Gebuehrenuebermittlung (Muenzfernsprecher)" },
|
||||||
{ 'e', "0111010000100001", 0x0000, "Funkwahlende" },
|
{ 'e', "0111010000100001", 0x0000, "Funkwahlende" },
|
||||||
{ 't', "0111010101010101", 0x0000, "Trennsignal/Schlusssignal" },
|
{ 't', "0111010101010101", 0x0000, "Trennsignal/Schlusssignal" },
|
||||||
/* Kanalbefehl B1 */
|
/* Kanalbefehl B1 */
|
||||||
|
Reference in New Issue
Block a user