Move from local to external osmo* libraries
src/libdebug -> libosmocore src/libselect -> libosmocore src/libtimer -> libosmocore src/libosmocc -> libosmo-cc src/libg711 -> libosmo-cc
This commit is contained in:
@@ -24,14 +24,10 @@ cnetz_LDADD = \
|
||||
../anetz/libgermanton.a \
|
||||
libcnetztones.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libdebug/libdebug.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libosmocc/libosmocc.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libcompandor/libcompandor.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
$(top_builddir)/src/libtimer/libtimer.a \
|
||||
$(top_builddir)/src/libselect/libselect.a \
|
||||
$(top_builddir)/src/libsamplerate/libsamplerate.a \
|
||||
$(top_builddir)/src/libscrambler/libscrambler.a \
|
||||
$(top_builddir)/src/libemphasis/libemphasis.a \
|
||||
@@ -39,8 +35,10 @@ cnetz_LDADD = \
|
||||
$(top_builddir)/src/libfilter/libfilter.a \
|
||||
$(top_builddir)/src/libwave/libwave.a \
|
||||
$(top_builddir)/src/libsample/libsample.a \
|
||||
$(top_builddir)/src/libg711/libg711.a \
|
||||
$(top_builddir)/src/libaaimage/libaaimage.a \
|
||||
$(top_builddir)/src/liblogging/liblogging.a \
|
||||
$(LIBOSMOCORE_LIBS) \
|
||||
$(LIBOSMOCC_LIBS) \
|
||||
-lm
|
||||
|
||||
if HAVE_ALSA
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
#include "../libcompandor/compandor.h"
|
||||
#include "../libtimer/timer.h"
|
||||
#include <osmocom/core/timer.h>
|
||||
#include "../libmobile/sender.h"
|
||||
#include "../libscrambler/scrambler.h"
|
||||
typedef struct cnetz cnetz_t;
|
||||
@@ -40,9 +40,9 @@ enum cnetz_state {
|
||||
#define N_AFKT 6 /* number of release frames to send during concentrated signaling */
|
||||
#define N_AFV 4 /* number of release frames to send during distributed signaling */
|
||||
#define N 3 /* now many times we repeat a message on OgK */
|
||||
#define T_VAG2 180 /* time on outgoing queue */
|
||||
#define T_VAK 60 /* time on incoming queue */
|
||||
#define T_AP 750 /* Time to wait for SIM card's authentication reply */
|
||||
#define T_VAG2 180,0 /* time on outgoing queue */
|
||||
#define T_VAK 60,0 /* time on incoming queue */
|
||||
#define T_AP 0,750000 /* Time to wait for SIM card's authentication reply */
|
||||
|
||||
/* clear causes */
|
||||
#define CNETZ_CAUSE_GASSENBESETZT 0 /* network congested */
|
||||
|
@@ -22,7 +22,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "../libsample/sample.h"
|
||||
#include "../libdebug/debug.h"
|
||||
#include "../liblogging/logging.h"
|
||||
#include "../libmobile/get_time.h"
|
||||
#include "cnetz.h"
|
||||
#include "database.h"
|
||||
#include "sysinfo.h"
|
||||
@@ -45,7 +46,7 @@ typedef struct cnetz_database {
|
||||
int eingebucht; /* set if still available */
|
||||
double last_seen;
|
||||
int busy; /* set if currently in a call */
|
||||
struct timer timer; /* timer for next availability check */
|
||||
struct osmo_timer_list timer; /* timer for next availability check */
|
||||
int retry; /* counts number of retries */
|
||||
} cnetz_db_t;
|
||||
|
||||
@@ -72,14 +73,14 @@ static void remove_db(cnetz_db_t *db)
|
||||
while (*dbp && *dbp != db)
|
||||
dbp = &((*dbp)->next);
|
||||
if (!(*dbp)) {
|
||||
PDEBUG(DDB, DEBUG_ERROR, "Subscriber not in list, please fix!!\n");
|
||||
LOGP(DDB, LOGL_ERROR, "Subscriber not in list, please fix!!\n");
|
||||
abort();
|
||||
}
|
||||
*dbp = db->next;
|
||||
|
||||
PDEBUG(DDB, DEBUG_INFO, "Removing subscriber '%d,%d,%05d' from database.\n", db->futln_nat, db->futln_fuvst, db->futln_rest);
|
||||
LOGP(DDB, LOGL_INFO, "Removing subscriber '%d,%d,%05d' from database.\n", db->futln_nat, db->futln_fuvst, db->futln_rest);
|
||||
|
||||
timer_exit(&db->timer);
|
||||
osmo_timer_del(&db->timer);
|
||||
|
||||
free(db);
|
||||
}
|
||||
@@ -90,15 +91,15 @@ static void db_timeout(void *data)
|
||||
cnetz_db_t *db = data;
|
||||
int rc;
|
||||
|
||||
PDEBUG(DDB, DEBUG_INFO, "Check, if subscriber '%d,%d,%05d' is still available.\n", db->futln_nat, db->futln_fuvst, db->futln_rest);
|
||||
LOGP(DDB, LOGL_INFO, "Check, if subscriber '%d,%d,%05d' is still available.\n", db->futln_nat, db->futln_fuvst, db->futln_rest);
|
||||
|
||||
rc = cnetz_meldeaufruf(db->futln_nat, db->futln_fuvst, db->futln_rest, db->ogk_kanal);
|
||||
if (rc < 0) {
|
||||
/* OgK is used for speech, but this never happens in a real
|
||||
* network. We just assume that the phone has responded and
|
||||
* assume we had a response. */
|
||||
PDEBUG(DDB, DEBUG_INFO, "OgK busy, so we assume a positive response.\n");
|
||||
timer_start(&db->timer, si.meldeinterval); /* when to check avaiability again */
|
||||
LOGP(DDB, LOGL_INFO, "OgK busy, so we assume a positive response.\n");
|
||||
osmo_timer_schedule(&db->timer, si.meldeinterval,0); /* when to check avaiability again */
|
||||
db->retry = 0;
|
||||
}
|
||||
}
|
||||
@@ -120,10 +121,10 @@ int update_db(uint8_t futln_nat, uint8_t futln_fuvst, uint16_t futln_rest, int o
|
||||
if (!db) {
|
||||
db = calloc(1, sizeof(*db));
|
||||
if (!db) {
|
||||
PDEBUG(DDB, DEBUG_ERROR, "No memory!\n");
|
||||
LOGP(DDB, LOGL_ERROR, "No memory!\n");
|
||||
return 0;
|
||||
}
|
||||
timer_init(&db->timer, db_timeout, db);
|
||||
osmo_timer_setup(&db->timer, db_timeout, db);
|
||||
|
||||
db->eingebucht = 1;
|
||||
db->futln_nat = futln_nat;
|
||||
@@ -136,7 +137,7 @@ int update_db(uint8_t futln_nat, uint8_t futln_fuvst, uint16_t futln_rest, int o
|
||||
dbp = &((*dbp)->next);
|
||||
*dbp = db;
|
||||
|
||||
PDEBUG(DDB, DEBUG_INFO, "Adding subscriber '%d,%d,%05d' to database.\n", db->futln_nat, db->futln_fuvst, db->futln_rest);
|
||||
LOGP(DDB, LOGL_INFO, "Adding subscriber '%d,%d,%05d' to database.\n", db->futln_nat, db->futln_fuvst, db->futln_rest);
|
||||
}
|
||||
|
||||
if (ogk_kanal)
|
||||
@@ -150,23 +151,23 @@ int update_db(uint8_t futln_nat, uint8_t futln_fuvst, uint16_t futln_rest, int o
|
||||
|
||||
db->busy = busy;
|
||||
if (busy) {
|
||||
PDEBUG(DDB, DEBUG_INFO, "Subscriber '%d,%d,%05d' on OGK channel #%d is busy now.\n", db->futln_nat, db->futln_fuvst, db->futln_rest, db->ogk_kanal);
|
||||
timer_stop(&db->timer);
|
||||
LOGP(DDB, LOGL_INFO, "Subscriber '%d,%d,%05d' on OGK channel #%d is busy now.\n", db->futln_nat, db->futln_fuvst, db->futln_rest, db->ogk_kanal);
|
||||
osmo_timer_del(&db->timer);
|
||||
} else if (!failed) {
|
||||
PDEBUG(DDB, DEBUG_INFO, "Subscriber '%d,%d,%05d' on OGK channel #%d is idle now.\n", db->futln_nat, db->futln_fuvst, db->futln_rest, db->ogk_kanal);
|
||||
timer_start(&db->timer, si.meldeinterval); /* when to check avaiability (again) */
|
||||
LOGP(DDB, LOGL_INFO, "Subscriber '%d,%d,%05d' on OGK channel #%d is idle now.\n", db->futln_nat, db->futln_fuvst, db->futln_rest, db->ogk_kanal);
|
||||
osmo_timer_schedule(&db->timer, si.meldeinterval,0); /* when to check avaiability (again) */
|
||||
db->retry = 0;
|
||||
db->eingebucht = 1;
|
||||
db->last_seen = get_time();
|
||||
} else {
|
||||
db->retry++;
|
||||
PDEBUG(DDB, DEBUG_NOTICE, "Paging subscriber '%d,%d,%05d' on OGK channel #%d failed (try %d of %s).\n", db->futln_nat, db->futln_fuvst, db->futln_rest, db->ogk_kanal, db->retry, print_meldeaufrufe(si.meldeaufrufe));
|
||||
LOGP(DDB, LOGL_NOTICE, "Paging subscriber '%d,%d,%05d' on OGK channel #%d failed (try %d of %s).\n", db->futln_nat, db->futln_fuvst, db->futln_rest, db->ogk_kanal, db->retry, print_meldeaufrufe(si.meldeaufrufe));
|
||||
if (si.meldeaufrufe && db->retry == si.meldeaufrufe) {
|
||||
PDEBUG(DDB, DEBUG_INFO, "Marking subscriber as gone.\n");
|
||||
LOGP(DDB, LOGL_INFO, "Marking subscriber as gone.\n");
|
||||
db->eingebucht = 0;
|
||||
return db->extended;
|
||||
}
|
||||
timer_start(&db->timer, (si.meldeinterval < MELDE_WIEDERHOLUNG) ? si.meldeinterval : MELDE_WIEDERHOLUNG); /* when to do retry */
|
||||
osmo_timer_schedule(&db->timer, (si.meldeinterval < MELDE_WIEDERHOLUNG) ? si.meldeinterval : MELDE_WIEDERHOLUNG,0); /* when to do retry */
|
||||
}
|
||||
|
||||
if (futelg_bit)
|
||||
@@ -211,18 +212,18 @@ void dump_db(void)
|
||||
int last;
|
||||
char attached[16];
|
||||
|
||||
PDEBUG(DDB, DEBUG_NOTICE, "Dump of subscriber database:\n");
|
||||
LOGP(DDB, LOGL_NOTICE, "Dump of subscriber database:\n");
|
||||
if (!db) {
|
||||
PDEBUG(DDB, DEBUG_NOTICE, " - No subscribers attached!\n");
|
||||
LOGP(DDB, LOGL_NOTICE, " - No subscribers attached!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
PDEBUG(DDB, DEBUG_NOTICE, "Subscriber\tAttached\tBusy\t\tLast seen\tMeldeaufrufe\n");
|
||||
PDEBUG(DDB, DEBUG_NOTICE, "-------------------------------------------------------------------------------\n");
|
||||
LOGP(DDB, LOGL_NOTICE, "Subscriber\tAttached\tBusy\t\tLast seen\tMeldeaufrufe\n");
|
||||
LOGP(DDB, LOGL_NOTICE, "-------------------------------------------------------------------------------\n");
|
||||
while (db) {
|
||||
last = (db->busy) ? 0 : (uint32_t)(now - db->last_seen);
|
||||
sprintf(attached, "YES (OGK %d)", db->ogk_kanal);
|
||||
PDEBUG(DDB, DEBUG_NOTICE, "%d,%d,%05d\t%s\t%s\t\t%02d:%02d:%02d \t%d/%s\n", db->futln_nat, db->futln_fuvst, db->futln_rest, (db->eingebucht) ? attached : "-no-\t", (db->busy) ? "YES" : "-no-", last / 3600, (last / 60) % 60, last % 60, db->retry, print_meldeaufrufe(si.meldeaufrufe));
|
||||
LOGP(DDB, LOGL_NOTICE, "%d,%d,%05d\t%s\t%s\t\t%02d:%02d:%02d \t%d/%s\n", db->futln_nat, db->futln_fuvst, db->futln_rest, (db->eingebucht) ? attached : "-no-\t", (db->busy) ? "YES" : "-no-", last / 3600, (last / 60) % 60, last % 60, db->retry, print_meldeaufrufe(si.meldeaufrufe));
|
||||
db = db->next;
|
||||
}
|
||||
}
|
||||
|
@@ -26,8 +26,9 @@
|
||||
#include <math.h>
|
||||
#include <errno.h>
|
||||
#include "../libsample/sample.h"
|
||||
#include "../libdebug/debug.h"
|
||||
#include "../liblogging/logging.h"
|
||||
#include "../libmobile/call.h"
|
||||
#include "../libmobile/get_time.h"
|
||||
#include "cnetz.h"
|
||||
#include "sysinfo.h"
|
||||
#include "telegramm.h"
|
||||
@@ -84,7 +85,7 @@ static void dsp_init_ramp(cnetz_t *cnetz)
|
||||
double c;
|
||||
int i;
|
||||
|
||||
PDEBUG(DDSP, DEBUG_DEBUG, "Generating smooth ramp table.\n");
|
||||
LOGP(DDSP, LOGL_DEBUG, "Generating smooth ramp table.\n");
|
||||
for (i = 0; i < 256; i++) {
|
||||
/* use square-root of cosine ramp. tests showed that phones are more
|
||||
* happy with that. (This is not correct pulse shaping!) */
|
||||
@@ -104,7 +105,7 @@ int dsp_init_sender(cnetz_t *cnetz, int measure_speed, double clock_speed[2], en
|
||||
int rc = 0;
|
||||
double size;
|
||||
|
||||
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Init FSK for 'Sender'.\n");
|
||||
LOGP_CHAN(DDSP, LOGL_DEBUG, "Init FSK for 'Sender'.\n");
|
||||
|
||||
/* set modulation parameters */
|
||||
sender_set_fm(&cnetz->sender, MAX_DEVIATION, MAX_MODULATION, speech_deviation, MAX_DISPLAY);
|
||||
@@ -115,20 +116,20 @@ int dsp_init_sender(cnetz_t *cnetz, int measure_speed, double clock_speed[2], en
|
||||
}
|
||||
|
||||
if (clock_speed[0] > 1000 || clock_speed[0] < -1000 || clock_speed[1] > 1000 || clock_speed[1] < -1000) {
|
||||
PDEBUG_CHAN(DDSP, DEBUG_ERROR, "Clock speed %.1f,%.1f ppm out of range! Please use range between +-1000 ppm!\n", clock_speed[0], clock_speed[1]);
|
||||
LOGP_CHAN(DDSP, LOGL_ERROR, "Clock speed %.1f,%.1f ppm out of range! Please use range between +-1000 ppm!\n", clock_speed[0], clock_speed[1]);
|
||||
return -EINVAL;
|
||||
}
|
||||
PDEBUG_CHAN(DDSP, DEBUG_INFO, "Using clock speed of %.1f ppm (RX) and %.1f ppm (TX) to correct sound card's clock.\n", clock_speed[0], clock_speed[1]);
|
||||
LOGP_CHAN(DDSP, LOGL_INFO, "Using clock speed of %.1f ppm (RX) and %.1f ppm (TX) to correct sound card's clock.\n", clock_speed[0], clock_speed[1]);
|
||||
|
||||
cnetz->fsk_bitduration = (double)cnetz->sender.samplerate / ((double)BITRATE / (1.0 + clock_speed[1] / 1000000.0));
|
||||
cnetz->fsk_tx_bitstep = 1.0 / cnetz->fsk_bitduration;
|
||||
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Use %.4f samples for one bit duration @ %d.\n", cnetz->fsk_bitduration, cnetz->sender.samplerate);
|
||||
LOGP_CHAN(DDSP, LOGL_DEBUG, "Use %.4f samples for one bit duration @ %d.\n", cnetz->fsk_bitduration, cnetz->sender.samplerate);
|
||||
|
||||
size = cnetz->fsk_bitduration * (double)BLOCK_BITS * 16.0; /* 16 blocks for distributed frames */
|
||||
cnetz->fsk_tx_buffer_size = size * 1.1; /* more to compensate clock speed */
|
||||
cnetz->fsk_tx_buffer = calloc(sizeof(sample_t), cnetz->fsk_tx_buffer_size);
|
||||
if (!cnetz->fsk_tx_buffer) {
|
||||
PDEBUG_CHAN(DDSP, DEBUG_ERROR, "No memory!\n");
|
||||
LOGP_CHAN(DDSP, LOGL_ERROR, "No memory!\n");
|
||||
rc = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
@@ -143,7 +144,7 @@ int dsp_init_sender(cnetz_t *cnetz, int measure_speed, double clock_speed[2], en
|
||||
/* create speech buffer */
|
||||
cnetz->dsp_speech_buffer = calloc(sizeof(sample_t), (int)(cnetz->fsk_bitduration * 70.0)); /* more to compensate clock speed. we just need it to fill 62 bits (60 bits, including pause bits). */
|
||||
if (!cnetz->dsp_speech_buffer) {
|
||||
PDEBUG_CHAN(DDSP, DEBUG_ERROR, "No memory!\n");
|
||||
LOGP_CHAN(DDSP, LOGL_ERROR, "No memory!\n");
|
||||
rc = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
@@ -169,7 +170,7 @@ int dsp_init_sender(cnetz_t *cnetz, int measure_speed, double clock_speed[2], en
|
||||
#ifdef TEST_SCRAMBLE
|
||||
rc = jitter_create(&scrambler_test_jb, "scramble", cnetz->sender.samplerate, sizeof(sample_t), JITTER_AUDIO);
|
||||
if (rc < 0) {
|
||||
PDEBUG_CHAN(DDSP, DEBUG_ERROR, "Failed to init jitter buffer for scrambler test!\n");
|
||||
LOGP_CHAN(DDSP, LOGL_ERROR, "Failed to init jitter buffer for scrambler test!\n");
|
||||
exit(0);
|
||||
}
|
||||
scrambler_setup(&scrambler_test_scrambler1, cnetz->sender.samplerate);
|
||||
@@ -188,7 +189,7 @@ error:
|
||||
|
||||
void dsp_cleanup_sender(cnetz_t *cnetz)
|
||||
{
|
||||
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Cleanup FSK for 'Sender'.\n");
|
||||
LOGP_CHAN(DDSP, LOGL_DEBUG, "Cleanup FSK for 'Sender'.\n");
|
||||
|
||||
if (cnetz->fsk_tx_buffer) {
|
||||
free(cnetz->fsk_tx_buffer);
|
||||
@@ -256,7 +257,7 @@ void calc_clock_speed(cnetz_t *cnetz, double samples, int tx, int result)
|
||||
speed_ppm_avg[index] += cs->speed_ppm[index][(cs->idx[index] - i - 1) & 0xff];
|
||||
speed_ppm_avg[index] /= (double)cs->num[index];
|
||||
}
|
||||
PDEBUG_CHAN(DDSP, DEBUG_NOTICE, "Clock: RX=%.3f TX=%.3f; Signal: RX=%.3f TX=%.3f ppm\n", speed_ppm_avg[0], speed_ppm_avg[1], speed_ppm_avg[2], speed_ppm_avg[3]);
|
||||
LOGP_CHAN(DDSP, LOGL_NOTICE, "Clock: RX=%.3f TX=%.3f; Signal: RX=%.3f TX=%.3f ppm\n", speed_ppm_avg[0], speed_ppm_avg[1], speed_ppm_avg[2], speed_ppm_avg[3]);
|
||||
}
|
||||
|
||||
static int fsk_nothing_encode(cnetz_t *cnetz)
|
||||
@@ -642,10 +643,10 @@ again:
|
||||
* because one has a phase wrap before and the other after a sample.
|
||||
* then we do it next super frame cycle */
|
||||
if (master->frame_last_scount == cnetz->fsk_tx_scount) {
|
||||
PDEBUG(DDSP, DEBUG_DEBUG, "Sync phase of slave to master: master=%.15f, slave=%.15f, diff=%.15f\n", master->frame_last_phase, cnetz->fsk_tx_phase, master->frame_last_phase - cnetz->fsk_tx_phase);
|
||||
LOGP(DDSP, LOGL_DEBUG, "Sync phase of slave to master: master=%.15f, slave=%.15f, diff=%.15f\n", master->frame_last_phase, cnetz->fsk_tx_phase, master->frame_last_phase - cnetz->fsk_tx_phase);
|
||||
cnetz->fsk_tx_phase = master->frame_last_phase;
|
||||
} else {
|
||||
PDEBUG(DDSP, DEBUG_DEBUG, "Not sync phase of slave to master: Sample counts during frame change are different, ignoring this time!\n");
|
||||
LOGP(DDSP, LOGL_DEBUG, "Not sync phase of slave to master: Sample counts during frame change are different, ignoring this time!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -654,7 +655,7 @@ again:
|
||||
if (cnetz->sched_dsp_mode_ts >= 0 && cnetz->sched_r_m == 0) {
|
||||
if (cnetz->sched_dsp_mode_ts == cnetz->sched_ts) {
|
||||
/* OgK / SpK(K) / SpK(V) */
|
||||
PDEBUG_CHAN(DDSP, DEBUG_INFO, "Now switching channel mode to %s at timeslot %d\n", cnetz_dsp_mode_name(cnetz->sched_dsp_mode), cnetz->sched_dsp_mode_ts);
|
||||
LOGP_CHAN(DDSP, LOGL_INFO, "Now switching channel mode to %s at timeslot %d\n", cnetz_dsp_mode_name(cnetz->sched_dsp_mode), cnetz->sched_dsp_mode_ts);
|
||||
cnetz->sched_dsp_mode_ts = -1;
|
||||
cnetz_set_dsp_mode(cnetz, cnetz->sched_dsp_mode);
|
||||
}
|
||||
@@ -671,14 +672,14 @@ again:
|
||||
cnetz->sched_last_ts = cnetz->sched_ts;
|
||||
bits = cnetz_encode_telegramm(cnetz);
|
||||
if (bits) {
|
||||
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Transmitting 'Rufblock' at timeslot %d\n", cnetz->sched_ts);
|
||||
LOGP_CHAN(DDSP, LOGL_DEBUG, "Transmitting 'Rufblock' at timeslot %d\n", cnetz->sched_ts);
|
||||
fsk_block_encode(cnetz, bits, 1);
|
||||
} else
|
||||
fsk_nothing_encode(cnetz);
|
||||
} else {
|
||||
bits = cnetz_encode_telegramm(cnetz);
|
||||
if (bits) {
|
||||
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Transmitting 'Meldeblock' at timeslot %d\n", cnetz->sched_ts);
|
||||
LOGP_CHAN(DDSP, LOGL_DEBUG, "Transmitting 'Meldeblock' at timeslot %d\n", cnetz->sched_ts);
|
||||
fsk_block_encode(cnetz, bits, 1);
|
||||
} else
|
||||
fsk_nothing_encode(cnetz);
|
||||
@@ -690,7 +691,7 @@ again:
|
||||
case DSP_MODE_SPK_K:
|
||||
bits = cnetz_encode_telegramm(cnetz);
|
||||
if (bits) {
|
||||
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Transmitting 'Konzentrierte Signalisierung' at timeslot %d.%d\n", cnetz->sched_ts, cnetz->sched_r_m * 5);
|
||||
LOGP_CHAN(DDSP, LOGL_DEBUG, "Transmitting 'Konzentrierte Signalisierung' at timeslot %d.%d\n", cnetz->sched_ts, cnetz->sched_r_m * 5);
|
||||
fsk_block_encode(cnetz, bits, 0);
|
||||
} else
|
||||
fsk_nothing_encode(cnetz);
|
||||
@@ -698,7 +699,7 @@ again:
|
||||
case DSP_MODE_SPK_V:
|
||||
bits = cnetz_encode_telegramm(cnetz);
|
||||
if (bits) {
|
||||
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Transmitting 'Verteilte Signalisierung' starting at timeslot %d\n", cnetz->sched_ts);
|
||||
LOGP_CHAN(DDSP, LOGL_DEBUG, "Transmitting 'Verteilte Signalisierung' starting at timeslot %d\n", cnetz->sched_ts);
|
||||
fsk_distributed_encode(cnetz, bits);
|
||||
} else
|
||||
fsk_nothing_encode(cnetz);
|
||||
@@ -860,7 +861,7 @@ void unshrink_speech(cnetz_t *cnetz, sample_t *speech_buffer, int count)
|
||||
void cnetz_set_dsp_mode(cnetz_t *cnetz, enum dsp_mode mode)
|
||||
{
|
||||
if (mode != cnetz->dsp_mode) {
|
||||
PDEBUG_CHAN(DDSP, DEBUG_INFO, "DSP mode %s -> %s\n", cnetz_dsp_mode_name(cnetz->dsp_mode), cnetz_dsp_mode_name(mode));
|
||||
LOGP_CHAN(DDSP, LOGL_INFO, "DSP mode %s -> %s\n", cnetz_dsp_mode_name(cnetz->dsp_mode), cnetz_dsp_mode_name(mode));
|
||||
cnetz->dsp_mode = mode;
|
||||
}
|
||||
/* we must get rid of partly received frame */
|
||||
@@ -870,10 +871,10 @@ void cnetz_set_dsp_mode(cnetz_t *cnetz, enum dsp_mode mode)
|
||||
void cnetz_set_sched_dsp_mode(cnetz_t *cnetz, enum dsp_mode mode, int timeslot)
|
||||
{
|
||||
if (cnetz->sched_dsp_mode_ts < 0 && mode == cnetz->dsp_mode) {
|
||||
PDEBUG_CHAN(DDSP, DEBUG_INFO, "Schedule DSP mode %s not required, we are already in that mode\n", cnetz_dsp_mode_name(mode));
|
||||
LOGP_CHAN(DDSP, LOGL_INFO, "Schedule DSP mode %s not required, we are already in that mode\n", cnetz_dsp_mode_name(mode));
|
||||
return;
|
||||
}
|
||||
PDEBUG_CHAN(DDSP, DEBUG_INFO, "Schedule DSP mode %s -> %s at timeslot %d\n", cnetz_dsp_mode_name(cnetz->dsp_mode), cnetz_dsp_mode_name(mode), timeslot);
|
||||
LOGP_CHAN(DDSP, LOGL_INFO, "Schedule DSP mode %s -> %s at timeslot %d\n", cnetz_dsp_mode_name(cnetz->dsp_mode), cnetz_dsp_mode_name(mode), timeslot);
|
||||
cnetz->sched_dsp_mode = mode;
|
||||
cnetz->sched_dsp_mode_ts = timeslot;
|
||||
}
|
||||
|
@@ -132,7 +132,7 @@ static int debug = 0;
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "../libsample/sample.h"
|
||||
#include "../libdebug/debug.h"
|
||||
#include "../liblogging/logging.h"
|
||||
#include "cnetz.h"
|
||||
#include "dsp.h"
|
||||
#include "telegramm.h"
|
||||
@@ -143,7 +143,7 @@ int fsk_fm_init(fsk_fm_demod_t *fsk, cnetz_t *cnetz, int samplerate, double bitr
|
||||
|
||||
memset(fsk, 0, sizeof(*fsk));
|
||||
if (samplerate < 48000) {
|
||||
PDEBUG(DDSP, DEBUG_ERROR, "Sample rate must be at least 48000 Hz!\n");
|
||||
LOGP(DDSP, LOGL_ERROR, "Sample rate must be at least 48000 Hz!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -152,13 +152,13 @@ int fsk_fm_init(fsk_fm_demod_t *fsk, cnetz_t *cnetz, int samplerate, double bitr
|
||||
|
||||
switch (demod) {
|
||||
case FSK_DEMOD_SLOPE:
|
||||
PDEBUG(DDSP, DEBUG_INFO, "Detecting level change by looking at slope (good for sound cards)\n");
|
||||
LOGP(DDSP, LOGL_INFO, "Detecting level change by looking at slope (good for sound cards)\n");
|
||||
break;
|
||||
case FSK_DEMOD_LEVEL:
|
||||
PDEBUG(DDSP, DEBUG_INFO, "Detecting level change by looking zero crosssing (good for SDR)\n");
|
||||
LOGP(DDSP, LOGL_INFO, "Detecting level change by looking zero crosssing (good for SDR)\n");
|
||||
break;
|
||||
default:
|
||||
PDEBUG(DDSP, DEBUG_ERROR, "Wrong demod type, please fix!\n");
|
||||
LOGP(DDSP, LOGL_ERROR, "Wrong demod type, please fix!\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ int fsk_fm_init(fsk_fm_demod_t *fsk, cnetz_t *cnetz, int samplerate, double bitr
|
||||
half = (int)((double)samplerate / bitrate / 2.0 + 0.5);
|
||||
fsk->bit_buffer_spl = calloc(sizeof(fsk->bit_buffer_spl[0]), len);
|
||||
if (!fsk->bit_buffer_spl) {
|
||||
PDEBUG(DDSP, DEBUG_ERROR, "No mem!\n");
|
||||
LOGP(DDSP, LOGL_ERROR, "No mem!\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ int fsk_fm_init(fsk_fm_demod_t *fsk, cnetz_t *cnetz, int samplerate, double bitr
|
||||
fsk->speech_size = samplerate * 60 / bitrate + 10; /* 60 bits duration, add 10 to be safe */
|
||||
fsk->speech_buffer = calloc(sizeof(fsk->speech_buffer[0]), fsk->speech_size);
|
||||
if (!fsk->speech_buffer) {
|
||||
PDEBUG(DDSP, DEBUG_ERROR, "No mem!\n");
|
||||
LOGP(DDSP, LOGL_ERROR, "No mem!\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#include <errno.h>
|
||||
#include "../libsample/sample.h"
|
||||
#include "../libmobile/main_mobile.h"
|
||||
#include "../libdebug/debug.h"
|
||||
#include "../liblogging/logging.h"
|
||||
#include "../libmobile/call.h"
|
||||
#include "../anetz/freiton.h"
|
||||
#include "../anetz/besetztton.h"
|
||||
@@ -700,6 +700,7 @@ fail:
|
||||
cnetz_destroy(sender_head);
|
||||
|
||||
/* exits */
|
||||
main_mobile_exit();
|
||||
fm_exit();
|
||||
|
||||
options_free();
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include "../libsample/sample.h"
|
||||
#include "../libdebug/debug.h"
|
||||
#include "../liblogging/logging.h"
|
||||
#include "cnetz.h"
|
||||
#include "dsp.h"
|
||||
#include "sysinfo.h"
|
||||
@@ -510,13 +510,13 @@ static int encode_dialstring(uint64_t *value, const char *number)
|
||||
|
||||
max = strlen(number);
|
||||
if (max > 16) {
|
||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Given number '%s' has more than 16 digits\n", number);
|
||||
LOGP(DFRAME, LOGL_NOTICE, "Given number '%s' has more than 16 digits\n", number);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (max == 16) {
|
||||
if (number[0] != '0') {
|
||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Given 16 digit number '%s' does not start with '0'\n", number);
|
||||
LOGP(DFRAME, LOGL_NOTICE, "Given 16 digit number '%s' does not start with '0'\n", number);
|
||||
return -EINVAL;
|
||||
}
|
||||
*value = 0;
|
||||
@@ -575,7 +575,7 @@ int match_fuz(telegramm_t *telegramm)
|
||||
if (telegramm->fuz_nationalitaet != si.fuz_nat
|
||||
|| telegramm->fuz_fuvst_nr != si.fuz_fuvst
|
||||
|| telegramm->fuz_rest_nr != si.fuz_rest) {
|
||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Ignoring message from mobile phone %d,%d,%d: Cell 'Funkzelle' does not match!\n", telegramm->futln_nationalitaet, telegramm->futln_heimat_fuvst_nr, telegramm->futln_rest_nr);
|
||||
LOGP(DFRAME, LOGL_NOTICE, "Ignoring message from mobile phone %d,%d,%d: Cell 'Funkzelle' does not match!\n", telegramm->futln_nationalitaet, telegramm->futln_heimat_fuvst_nr, telegramm->futln_rest_nr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ int match_futln(telegramm_t *telegramm, uint8_t futln_nat, uint8_t futln_fuvst,
|
||||
if (telegramm->futln_nationalitaet != futln_nat
|
||||
|| telegramm->futln_heimat_fuvst_nr != futln_fuvst
|
||||
|| telegramm->futln_rest_nr != futln_rest) {
|
||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Ignoring message from mobile phone %d,%d,%d: Mobile station 'Funktelefongeraet' does not match!\n", telegramm->futln_nationalitaet, telegramm->futln_heimat_fuvst_nr, telegramm->futln_rest_nr);
|
||||
LOGP(DFRAME, LOGL_NOTICE, "Ignoring message from mobile phone %d,%d,%d: Mobile station 'Funktelefongeraet' does not match!\n", telegramm->futln_nationalitaet, telegramm->futln_heimat_fuvst_nr, telegramm->futln_rest_nr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -600,19 +600,19 @@ static void debug_parameter(char digit, uint64_t value)
|
||||
|
||||
parameter = get_parameter(digit);
|
||||
if (!parameter) {
|
||||
PDEBUG(DFRAME, DEBUG_ERROR, "Digit '%c' not found in definition_parameter list, please fix!\n", digit);
|
||||
LOGP(DFRAME, LOGL_ERROR, "Digit '%c' not found in definition_parameter list, please fix!\n", digit);
|
||||
abort();
|
||||
}
|
||||
if (parameter->value_names)
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : %s\n", digit, parameter->param_name, parameter->value_names[value]);
|
||||
LOGP(DFRAME, LOGL_DEBUG, " (%c) %s : %s\n", digit, parameter->param_name, parameter->value_names[value]);
|
||||
else if (parameter->bits == 64)
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : 0x%016" PRIx64 "\n", digit, parameter->param_name, value);
|
||||
LOGP(DFRAME, LOGL_DEBUG, " (%c) %s : 0x%016" PRIx64 "\n", digit, parameter->param_name, value);
|
||||
else if (digit == 'X') {
|
||||
char wahlziffern[17];
|
||||
decode_dialstring(wahlziffern, value);
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : '%s'\n", digit, parameter->param_name, wahlziffern);
|
||||
LOGP(DFRAME, LOGL_DEBUG, " (%c) %s : '%s'\n", digit, parameter->param_name, wahlziffern);
|
||||
} else
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : %" PRIu64 "\n", digit, parameter->param_name, value);
|
||||
LOGP(DFRAME, LOGL_DEBUG, " (%c) %s : %" PRIu64 "\n", digit, parameter->param_name, value);
|
||||
}
|
||||
|
||||
/* encode telegram to 70 bits
|
||||
@@ -628,12 +628,12 @@ static char *assemble_telegramm(const telegramm_t *telegramm, int debug)
|
||||
int rc;
|
||||
|
||||
if (telegramm->opcode >= 64) {
|
||||
PDEBUG(DFRAME, DEBUG_ERROR, "Opcode '0x%x' exceeds bit range, please fix!\n", telegramm->opcode);
|
||||
LOGP(DFRAME, LOGL_ERROR, "Opcode '0x%x' exceeds bit range, please fix!\n", telegramm->opcode);
|
||||
abort();
|
||||
}
|
||||
|
||||
if (debug)
|
||||
PDEBUG(DFRAME, DEBUG_INFO, "Coding %s %s\n", definition_opcode[telegramm->opcode].message_name, definition_opcode[telegramm->opcode].message_text);
|
||||
LOGP(DFRAME, LOGL_INFO, "Coding %s %s\n", definition_opcode[telegramm->opcode].message_name, definition_opcode[telegramm->opcode].message_text);
|
||||
|
||||
/* copy opcode */
|
||||
for (i = 0; i < 6; i++)
|
||||
@@ -717,7 +717,7 @@ static char *assemble_telegramm(const telegramm_t *telegramm, int debug)
|
||||
case 'X':
|
||||
rc = encode_dialstring(&value, telegramm->wahlziffern);
|
||||
if (rc < 0) {
|
||||
PDEBUG(DFRAME, DEBUG_ERROR, "Illegal dial string '%s', please fix!\n", telegramm->wahlziffern);
|
||||
LOGP(DFRAME, LOGL_ERROR, "Illegal dial string '%s', please fix!\n", telegramm->wahlziffern);
|
||||
abort();
|
||||
}
|
||||
break;
|
||||
@@ -806,10 +806,10 @@ static char *assemble_telegramm(const telegramm_t *telegramm, int debug)
|
||||
value = telegramm->illegaler_opcode;
|
||||
break;
|
||||
default:
|
||||
PDEBUG(DFRAME, DEBUG_ERROR, "Parameter '%c' does not exist, please fix!\n", parameter);
|
||||
LOGP(DFRAME, LOGL_ERROR, "Parameter '%c' does not exist, please fix!\n", parameter);
|
||||
abort();
|
||||
}
|
||||
if (debug && debuglevel <= DEBUG_DEBUG)
|
||||
if (debug && loglevel <= LOGL_DEBUG)
|
||||
debug_parameter(parameter, value);
|
||||
val = value;
|
||||
for (j = 0; string[63 - i - j] == parameter; j++) {
|
||||
@@ -817,14 +817,14 @@ static char *assemble_telegramm(const telegramm_t *telegramm, int debug)
|
||||
val >>= 1;
|
||||
}
|
||||
if (val)
|
||||
PDEBUG(DFRAME, DEBUG_ERROR, "Parameter '%c' value '0x%" PRIx64 "' exceeds bit range!\n", parameter, value);
|
||||
LOGP(DFRAME, LOGL_ERROR, "Parameter '%c' value '0x%" PRIx64 "' exceeds bit range!\n", parameter, value);
|
||||
i += j - 1;
|
||||
}
|
||||
bits[70] = '\0';
|
||||
|
||||
if (debug) {
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, "OOOOOO%s\n", string);
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, "%s\n", bits);
|
||||
LOGP(DFRAME, LOGL_DEBUG, "OOOOOO%s\n", string);
|
||||
LOGP(DFRAME, LOGL_DEBUG, "%s\n", bits);
|
||||
}
|
||||
|
||||
return bits;
|
||||
@@ -848,7 +848,7 @@ static void disassemble_telegramm(telegramm_t *telegramm, const char *bits, int
|
||||
value = (value << 1) | (bits[i] == '1');
|
||||
telegramm->opcode = value;
|
||||
|
||||
PDEBUG(DFRAME, DEBUG_INFO, "Decoding %s %s\n", definition_opcode[telegramm->opcode].message_name, definition_opcode[telegramm->opcode].message_text);
|
||||
LOGP(DFRAME, LOGL_INFO, "Decoding %s %s\n", definition_opcode[telegramm->opcode].message_name, definition_opcode[telegramm->opcode].message_text);
|
||||
|
||||
/* copy parameters */
|
||||
if (auth && bits[1]) /* auth flag and chip card flag */
|
||||
@@ -864,7 +864,7 @@ static void disassemble_telegramm(telegramm_t *telegramm, const char *bits, int
|
||||
value = (value >> 1) | ((uint64_t)(bits[69 - i - j] == '1') << 63);
|
||||
value >>= 64 - j;
|
||||
i += j - 1;
|
||||
if (debuglevel <= DEBUG_DEBUG)
|
||||
if (loglevel <= LOGL_DEBUG)
|
||||
debug_parameter(parameter, value);
|
||||
switch (parameter) {
|
||||
case 'A':
|
||||
@@ -1021,18 +1021,18 @@ static void disassemble_telegramm(telegramm_t *telegramm, const char *bits, int
|
||||
telegramm->illegaler_opcode = value;
|
||||
break;
|
||||
default:
|
||||
PDEBUG(DFRAME, DEBUG_ERROR, "Parameter '%c' does not exist, please fix!\n", parameter);
|
||||
LOGP(DFRAME, LOGL_ERROR, "Parameter '%c' does not exist, please fix!\n", parameter);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
if (debuglevel <= DEBUG_DEBUG) {
|
||||
if (loglevel <= LOGL_DEBUG) {
|
||||
char debug_bits[71];
|
||||
|
||||
memcpy(debug_bits, bits, 70);
|
||||
debug_bits[70] = '\0';
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, "OOOOOO%s\n", string);
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, "%s\n", debug_bits);
|
||||
LOGP(DFRAME, LOGL_DEBUG, "OOOOOO%s\n", string);
|
||||
LOGP(DFRAME, LOGL_DEBUG, "%s\n", debug_bits);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1392,11 +1392,11 @@ static const char *decode(const char *input, int *_bit_errors)
|
||||
fail_str[10] = '\0';
|
||||
|
||||
if (failed)
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, "Received Telegram with these block errors: '%s' (X = uncorrectable)\n", fail_str);
|
||||
LOGP(DFRAME, LOGL_DEBUG, "Received Telegram with these block errors: '%s' (X = uncorrectable)\n", fail_str);
|
||||
else if (warn)
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, "Received Telegram with these block errors: '%s' (1 / 2 = correctable)\n", fail_str);
|
||||
LOGP(DFRAME, LOGL_DEBUG, "Received Telegram with these block errors: '%s' (1 / 2 = correctable)\n", fail_str);
|
||||
else
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, "Received Telegram with no block errors.\n");
|
||||
LOGP(DFRAME, LOGL_DEBUG, "Received Telegram with no block errors.\n");
|
||||
|
||||
if (failed)
|
||||
return NULL;
|
||||
@@ -1496,13 +1496,13 @@ void cnetz_decode_telegramm(cnetz_t *cnetz, const char *bits, double level, doub
|
||||
break;
|
||||
}
|
||||
if (i == 70) {
|
||||
PDEBUG(DFRAME, DEBUG_INFO, "Ignoring mysterious unmodulated telegramm (noise from phone's transmitter)\n");
|
||||
LOGP(DFRAME, LOGL_INFO, "Ignoring mysterious unmodulated telegramm (noise from phone's transmitter)\n");
|
||||
return;
|
||||
}
|
||||
|
||||
PDEBUG_CHAN(DDSP, DEBUG_INFO, "RF level: %.1f dB RX Level: %.0f%% Standard deviation: %.0f%% Sync Time: %.2f (TS %.2f) %s\n", cnetz->rf_level_db, fabs(level) / cnetz->fsk_deviation * 100.0, stddev / fabs(level) * 100.0, sync_time, sync_time / 396.0, (level < 0) ? "NEGATIVE (phone's mode)" : "POSITIVE (base station's mode)");
|
||||
LOGP_CHAN(DDSP, LOGL_INFO, "RF level: %.1f dB RX Level: %.0f%% Standard deviation: %.0f%% Sync Time: %.2f (TS %.2f) %s\n", cnetz->rf_level_db, fabs(level) / cnetz->fsk_deviation * 100.0, stddev / fabs(level) * 100.0, sync_time, sync_time / 396.0, (level < 0) ? "NEGATIVE (phone's mode)" : "POSITIVE (base station's mode)");
|
||||
if (bit_errors)
|
||||
PDEBUG_CHAN(DDSP, DEBUG_INFO, " -> Frame has %d bit errors.\n", bit_errors);
|
||||
LOGP_CHAN(DDSP, LOGL_INFO, " -> Frame has %d bit errors.\n", bit_errors);
|
||||
|
||||
disassemble_telegramm(&telegramm, bits, si.authentifikationsbit);
|
||||
opcode = telegramm.opcode;
|
||||
@@ -1510,18 +1510,18 @@ void cnetz_decode_telegramm(cnetz_t *cnetz, const char *bits, double level, doub
|
||||
telegramm.sync_time = sync_time;
|
||||
|
||||
if (cnetz->sender.loopback) {
|
||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm in loopback test mode (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
LOGP(DFRAME, LOGL_NOTICE, "Received Telegramm in loopback test mode (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
cnetz_sync_frame(cnetz, sync_time, -1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (opcode >= 32) {
|
||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm that is not used by mobile station, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
LOGP(DFRAME, LOGL_NOTICE, "Received Telegramm that is not used by mobile station, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (definition_opcode[opcode].block == BLOCK_I) {
|
||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm that is an illegal opcode, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
LOGP(DFRAME, LOGL_NOTICE, "Received Telegramm that is an illegal opcode, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1544,7 +1544,7 @@ void cnetz_decode_telegramm(cnetz_t *cnetz, const char *bits, double level, doub
|
||||
switch (cnetz->dsp_mode) {
|
||||
case DSP_MODE_OGK:
|
||||
if (definition_opcode[opcode].block != BLOCK_R && definition_opcode[opcode].block != BLOCK_M) {
|
||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm that is not used OgK channel signaling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
LOGP(DFRAME, LOGL_NOTICE, "Received Telegramm that is not used OgK channel signaling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
return;
|
||||
}
|
||||
/* determine block by last timeslot sent and by message type
|
||||
@@ -1557,14 +1557,14 @@ void cnetz_decode_telegramm(cnetz_t *cnetz, const char *bits, double level, doub
|
||||
break;
|
||||
case DSP_MODE_SPK_K:
|
||||
if (definition_opcode[opcode].block != BLOCK_K) {
|
||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm that is not used for concentrated signaling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
LOGP(DFRAME, LOGL_NOTICE, "Received Telegramm that is not used for concentrated signaling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
return;
|
||||
}
|
||||
cnetz_receive_telegramm_spk_k(cnetz, &telegramm);
|
||||
break;
|
||||
case DSP_MODE_SPK_V:
|
||||
if (definition_opcode[opcode].block != BLOCK_V) {
|
||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm that is not used for distributed signaling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
LOGP(DFRAME, LOGL_NOTICE, "Received Telegramm that is not used for distributed signaling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||
return;
|
||||
}
|
||||
cnetz_receive_telegramm_spk_v(cnetz, &telegramm);
|
||||
@@ -1622,7 +1622,7 @@ const char *cnetz_encode_telegramm(cnetz_t *cnetz)
|
||||
cnetz->sched_lr_debugged = 1;
|
||||
if (opcode == OPCODE_MLR_M && !cnetz->sched_mlr_debugged) {
|
||||
cnetz->sched_mlr_debugged = 1;
|
||||
PDEBUG(DFRAME, DEBUG_INFO, "Subsequent IDLE frames are not show, to prevent flooding the output.\n");
|
||||
LOGP(DFRAME, LOGL_INFO, "Subsequent IDLE frames are not show, to prevent flooding the output.\n");
|
||||
}
|
||||
|
||||
return bits;
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include "../libsample/sample.h"
|
||||
#include "../libdebug/debug.h"
|
||||
#include "../liblogging/logging.h"
|
||||
#include "../libmobile/call.h"
|
||||
#include "../libmobile/cause.h"
|
||||
#include "cnetz.h"
|
||||
@@ -54,7 +54,7 @@ transaction_t *create_transaction(cnetz_t *cnetz, uint64_t state, uint8_t futln_
|
||||
if ((trans->state & state & (TRANS_EM | TRANS_UM | TRANS_VWG | TRANS_ATQ_IDLE))) {
|
||||
if (!isnan(trans->rf_level_db) && !isnan(rf_level_db) && trans->cnetz->kanal != cnetz->kanal) {
|
||||
if (rf_level_db > trans->rf_level_db) {
|
||||
PDEBUG(DTRANS, DEBUG_NOTICE, "Found already pending transaction for subscriber '%s' on channel #%d, but this message on channel #%d is stronger, so we move to that channel!\n", rufnummer, trans->cnetz->kanal, cnetz->kanal);
|
||||
LOGP(DTRANS, LOGL_NOTICE, "Found already pending transaction for subscriber '%s' on channel #%d, but this message on channel #%d is stronger, so we move to that channel!\n", rufnummer, trans->cnetz->kanal, cnetz->kanal);
|
||||
trans->rf_level_db = rf_level_db;
|
||||
unlink_transaction(trans);
|
||||
link_transaction(trans, cnetz);
|
||||
@@ -62,14 +62,14 @@ transaction_t *create_transaction(cnetz_t *cnetz, uint64_t state, uint8_t futln_
|
||||
return trans;
|
||||
}
|
||||
if (rf_level_db < trans->rf_level_db) {
|
||||
PDEBUG(DTRANS, DEBUG_NOTICE, "Found already pending transaction for subscriber '%s' on channel #%d, but this message on channel #%d is weaker, so we ignore that channel!\n", rufnummer, trans->cnetz->kanal, cnetz->kanal);
|
||||
LOGP(DTRANS, LOGL_NOTICE, "Found already pending transaction for subscriber '%s' on channel #%d, but this message on channel #%d is weaker, so we ignore that channel!\n", rufnummer, trans->cnetz->kanal, cnetz->kanal);
|
||||
return trans;
|
||||
}
|
||||
}
|
||||
PDEBUG(DTRANS, DEBUG_NOTICE, "Found already pending transaction for subscriber '%s' on channel #%d, but this message on channel #%d is also received. Try to avoid multiple OgK channels!\n", rufnummer, trans->cnetz->kanal, cnetz->kanal);
|
||||
LOGP(DTRANS, LOGL_NOTICE, "Found already pending transaction for subscriber '%s' on channel #%d, but this message on channel #%d is also received. Try to avoid multiple OgK channels!\n", rufnummer, trans->cnetz->kanal, cnetz->kanal);
|
||||
return trans;
|
||||
}
|
||||
PDEBUG(DTRANS, DEBUG_NOTICE, "Found already pending transaction for subscriber '%s', deleting!\n", rufnummer);
|
||||
LOGP(DTRANS, LOGL_NOTICE, "Found already pending transaction for subscriber '%s', deleting!\n", rufnummer);
|
||||
destroy_transaction(trans);
|
||||
if (old_cnetz) /* should be... */
|
||||
cnetz_go_idle(old_cnetz);
|
||||
@@ -79,11 +79,11 @@ transaction_t *create_transaction(cnetz_t *cnetz, uint64_t state, uint8_t futln_
|
||||
|
||||
trans = calloc(1, sizeof(*trans));
|
||||
if (!trans) {
|
||||
PDEBUG(DTRANS, DEBUG_ERROR, "No memory!\n");
|
||||
LOGP(DTRANS, LOGL_ERROR, "No memory!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
timer_init(&trans->timer, transaction_timeout, trans);
|
||||
osmo_timer_setup(&trans->timer, transaction_timeout, trans);
|
||||
|
||||
trans_new_state(trans, state);
|
||||
trans->futln_nat = futln_nat;
|
||||
@@ -96,7 +96,7 @@ transaction_t *create_transaction(cnetz_t *cnetz, uint64_t state, uint8_t futln_
|
||||
trans->mt_call = 1;
|
||||
|
||||
const char *rufnummer = transaction2rufnummer(trans);
|
||||
PDEBUG(DTRANS, DEBUG_INFO, "Created transaction for subscriber '%s'\n", rufnummer);
|
||||
LOGP(DTRANS, LOGL_INFO, "Created transaction for subscriber '%s'\n", rufnummer);
|
||||
|
||||
link_transaction(trans, cnetz);
|
||||
|
||||
@@ -119,9 +119,9 @@ void destroy_transaction(transaction_t *trans)
|
||||
unlink_transaction(trans);
|
||||
|
||||
const char *rufnummer = transaction2rufnummer(trans);
|
||||
PDEBUG(DTRANS, DEBUG_INFO, "Destroying transaction for subscriber '%s'\n", rufnummer);
|
||||
LOGP(DTRANS, LOGL_INFO, "Destroying transaction for subscriber '%s'\n", rufnummer);
|
||||
|
||||
timer_exit(&trans->timer);
|
||||
osmo_timer_del(&trans->timer);
|
||||
|
||||
trans_new_state(trans, 0);
|
||||
|
||||
@@ -134,7 +134,7 @@ void link_transaction(transaction_t *trans, cnetz_t *cnetz)
|
||||
transaction_t **transp;
|
||||
|
||||
/* attach to end of list, so first transaction is served first */
|
||||
PDEBUG(DTRANS, DEBUG_DEBUG, "Linking transaction %p to cnetz %p\n", trans, cnetz);
|
||||
LOGP(DTRANS, LOGL_DEBUG, "Linking transaction %p to cnetz %p\n", trans, cnetz);
|
||||
trans->cnetz = cnetz;
|
||||
trans->next = NULL;
|
||||
transp = &cnetz->trans_list;
|
||||
@@ -150,12 +150,12 @@ void unlink_transaction(transaction_t *trans)
|
||||
transaction_t **transp;
|
||||
|
||||
/* unlink */
|
||||
PDEBUG(DTRANS, DEBUG_DEBUG, "Unlinking transaction %p from cnetz %p\n", trans, trans->cnetz);
|
||||
LOGP(DTRANS, LOGL_DEBUG, "Unlinking transaction %p from cnetz %p\n", trans, trans->cnetz);
|
||||
transp = &trans->cnetz->trans_list;
|
||||
while (*transp && *transp != trans)
|
||||
transp = &((*transp)->next);
|
||||
if (!(*transp)) {
|
||||
PDEBUG(DTRANS, DEBUG_ERROR, "Transaction not in list, please fix!!\n");
|
||||
LOGP(DTRANS, LOGL_ERROR, "Transaction not in list, please fix!!\n");
|
||||
abort();
|
||||
}
|
||||
*transp = trans->next;
|
||||
@@ -170,7 +170,7 @@ transaction_t *search_transaction(cnetz_t *cnetz, uint64_t state_mask)
|
||||
while (trans) {
|
||||
if ((trans->state & state_mask)) {
|
||||
const char *rufnummer = transaction2rufnummer(trans);
|
||||
PDEBUG(DTRANS, DEBUG_DEBUG, "Found transaction for subscriber '%s'\n", rufnummer);
|
||||
LOGP(DTRANS, LOGL_DEBUG, "Found transaction for subscriber '%s'\n", rufnummer);
|
||||
return trans;
|
||||
}
|
||||
trans = trans->next;
|
||||
@@ -188,7 +188,7 @@ transaction_t *search_transaction_number(cnetz_t *cnetz, uint8_t futln_nat, uint
|
||||
&& trans->futln_fuvst == futln_fuvst
|
||||
&& trans->futln_rest == futln_rest) {
|
||||
const char *rufnummer = transaction2rufnummer(trans);
|
||||
PDEBUG(DTRANS, DEBUG_DEBUG, "Found transaction for subscriber '%s'\n", rufnummer);
|
||||
LOGP(DTRANS, LOGL_DEBUG, "Found transaction for subscriber '%s'\n", rufnummer);
|
||||
return trans;
|
||||
}
|
||||
trans = trans->next;
|
||||
@@ -224,7 +224,7 @@ transaction_t *search_transaction_callref(cnetz_t *cnetz, int callref)
|
||||
while (trans) {
|
||||
if (trans->callref == callref) {
|
||||
const char *rufnummer = transaction2rufnummer(trans);
|
||||
PDEBUG(DTRANS, DEBUG_DEBUG, "Found transaction for subscriber '%s'\n", rufnummer);
|
||||
LOGP(DTRANS, LOGL_DEBUG, "Found transaction for subscriber '%s'\n", rufnummer);
|
||||
return trans;
|
||||
}
|
||||
trans = trans->next;
|
||||
@@ -262,7 +262,7 @@ transaction_t *search_transaction_queue(void)
|
||||
|
||||
if (found) {
|
||||
const char *rufnummer = transaction2rufnummer(found);
|
||||
PDEBUG(DTRANS, DEBUG_DEBUG, "Found oldest transaction in queue for subscriber '%s'\n", rufnummer);
|
||||
LOGP(DTRANS, LOGL_DEBUG, "Found oldest transaction in queue for subscriber '%s'\n", rufnummer);
|
||||
return found;
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ const char *trans_short_state_name(uint64_t state)
|
||||
|
||||
void trans_new_state(transaction_t *trans, uint64_t state)
|
||||
{
|
||||
PDEBUG(DTRANS, DEBUG_INFO, "Transaction (%s) state %s -> %s\n", transaction2rufnummer(trans), trans_state_name(trans->state), trans_state_name(state));
|
||||
LOGP(DTRANS, LOGL_INFO, "Transaction (%s) state %s -> %s\n", transaction2rufnummer(trans), trans_state_name(trans->state), trans_state_name(state));
|
||||
trans->state = state;
|
||||
/* in case of a queue, set new positon */
|
||||
if (!trans->queue_position && (state == TRANS_MO_QUEUE || state == TRANS_MT_QUEUE))
|
||||
@@ -398,12 +398,12 @@ void cnetz_flush_other_transactions(cnetz_t *cnetz, transaction_t *trans)
|
||||
{
|
||||
/* flush after this very trans */
|
||||
while (trans->next) {
|
||||
PDEBUG(DTRANS, DEBUG_NOTICE, "Kicking other pending transaction\n");
|
||||
LOGP(DTRANS, LOGL_NOTICE, "Kicking other pending transaction\n");
|
||||
destroy_transaction(trans->next);
|
||||
}
|
||||
/* flush before this very trans */
|
||||
while (cnetz->trans_list != trans) {
|
||||
PDEBUG(DTRANS, DEBUG_NOTICE, "Kicking other pending transaction\n");
|
||||
LOGP(DTRANS, LOGL_NOTICE, "Kicking other pending transaction\n");
|
||||
destroy_transaction(cnetz->trans_list);
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ typedef struct transaction {
|
||||
int8_t release_cause; /* reason for release, (c-netz coding) */
|
||||
int try; /* counts resending messages */
|
||||
int repeat; /* counts repeating messages */
|
||||
struct timer timer; /* for varous timeouts */
|
||||
struct osmo_timer_list timer; /* for varous timeouts */
|
||||
int mo_call; /* flags a moile originating call */
|
||||
int mt_call; /* flags a moile terminating call */
|
||||
int page_failed; /* failed to get a response from MS */
|
||||
|
Reference in New Issue
Block a user