forked from cellular-infrastructure/osmocom-analog
Typos: acknowledgement -> acknowledgment signalling -> signaling
This commit is contained in:
parent
c273bbc5ff
commit
6a5af9aeac
2
README
2
README
|
@ -20,7 +20,7 @@ Carsten Wollesen for donating Telefunken 4015 B-Netz phone back in the 90's.
|
||||||
Klaus Adler for helping me to retrieve complete NMT specification and donating
|
Klaus Adler for helping me to retrieve complete NMT specification and donating
|
||||||
a BSA44 (magnetic card C-Netz hackable phone) back in the 90's.
|
a BSA44 (magnetic card C-Netz hackable phone) back in the 90's.
|
||||||
|
|
||||||
Andy Zauner for providing signalling specification of C-Netz back in the 90's.
|
Andy Zauner for providing signaling specification of C-Netz back in the 90's.
|
||||||
|
|
||||||
Hans Wigger for providing valuable informations about A-Netz and B-Netz and
|
Hans Wigger for providing valuable informations about A-Netz and B-Netz and
|
||||||
helping me to get an A-Netz phone.
|
helping me to get an A-Netz phone.
|
||||||
|
|
|
@ -510,21 +510,21 @@ static void amps_release(transaction_t *trans, uint8_t cause)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* receive signalling
|
* receive signaling
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void amps_rx_signalling_tone(amps_t *amps, int tone, double quality)
|
void amps_rx_signaling_tone(amps_t *amps, int tone, double quality)
|
||||||
{
|
{
|
||||||
transaction_t *trans = amps->trans_list;
|
transaction_t *trans = amps->trans_list;
|
||||||
if (trans == NULL) {
|
if (trans == NULL) {
|
||||||
PDEBUG(DAMPS, DEBUG_ERROR, "Signalling Tone without transaction, please fix!\n");
|
PDEBUG(DAMPS, DEBUG_ERROR, "Signaling Tone without transaction, please fix!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tone)
|
if (tone)
|
||||||
PDEBUG(DAMPS, DEBUG_INFO, "Detected Signalling Tone with quality=%.0f.\n", quality * 100.0);
|
PDEBUG(DAMPS, DEBUG_INFO, "Detected Signaling Tone with quality=%.0f.\n", quality * 100.0);
|
||||||
else
|
else
|
||||||
PDEBUG(DAMPS, DEBUG_INFO, "Lost Signalling Tone signal\n");
|
PDEBUG(DAMPS, DEBUG_INFO, "Lost Signaling Tone signal\n");
|
||||||
|
|
||||||
switch (trans->state) {
|
switch (trans->state) {
|
||||||
case TRANS_CALL:
|
case TRANS_CALL:
|
||||||
|
@ -559,7 +559,7 @@ void amps_rx_signalling_tone(amps_t *amps, int tone, double quality)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
PDEBUG(DAMPS, DEBUG_ERROR, "Signalling Tone without active call, please fix!\n");
|
PDEBUG(DAMPS, DEBUG_ERROR, "Signaling Tone without active call, please fix!\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -625,7 +625,7 @@ void amps_rx_recc(amps_t *amps, uint8_t scm, uint32_t esn, uint32_t min1, uint16
|
||||||
transaction_t *trans;
|
transaction_t *trans;
|
||||||
const char *callerid = amps_min2number(min1, min2);
|
const char *callerid = amps_min2number(min1, min2);
|
||||||
|
|
||||||
/* check if we are busy, so we ignore all signalling */
|
/* check if we are busy, so we ignore all signaling */
|
||||||
if (amps->state == STATE_BUSY) {
|
if (amps->state == STATE_BUSY) {
|
||||||
PDEBUG(DAMPS, DEBUG_NOTICE, "Ignoring RECC messages from phone while using this channel for voice.\n");
|
PDEBUG(DAMPS, DEBUG_NOTICE, "Ignoring RECC messages from phone while using this channel for voice.\n");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -160,7 +160,7 @@ const char *amps_min2number(uint32_t min1, uint16_t min2);
|
||||||
const char *amps_scm(uint8_t scm);
|
const char *amps_scm(uint8_t scm);
|
||||||
int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int loopback);
|
int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int loopback);
|
||||||
void amps_destroy(sender_t *sender);
|
void amps_destroy(sender_t *sender);
|
||||||
void amps_rx_signalling_tone(amps_t *amps, int tone, double quality);
|
void amps_rx_signaling_tone(amps_t *amps, int tone, double quality);
|
||||||
void amps_rx_sat(amps_t *amps, int tone, double quality);
|
void amps_rx_sat(amps_t *amps, int tone, double quality);
|
||||||
void amps_rx_recc(amps_t *amps, uint8_t scm, uint32_t esn, uint32_t min1, uint16_t min2, uint8_t msg_type, uint8_t ordq, uint8_t order, const char *dialing);
|
void amps_rx_recc(amps_t *amps, uint8_t scm, uint32_t esn, uint32_t min1, uint16_t min2, uint8_t msg_type, uint8_t ordq, uint8_t order, const char *dialing);
|
||||||
transaction_t *amps_tx_frame_focc(amps_t *amps);
|
transaction_t *amps_tx_frame_focc(amps_t *amps);
|
||||||
|
|
|
@ -78,14 +78,14 @@
|
||||||
#define COMPANDOR_0DB 45000 /* works quite well */
|
#define COMPANDOR_0DB 45000 /* works quite well */
|
||||||
#define BITRATE 10000
|
#define BITRATE 10000
|
||||||
#define SIG_TONE_CROSSINGS 2000 /* 2000 crossings are 100ms @ 10 KHz */
|
#define SIG_TONE_CROSSINGS 2000 /* 2000 crossings are 100ms @ 10 KHz */
|
||||||
#define SIG_TONE_MINBITS 950 /* minimum bit durations to detect signalling tone (1000 is perfect for 100 ms) */
|
#define SIG_TONE_MINBITS 950 /* minimum bit durations to detect signaling tone (1000 is perfect for 100 ms) */
|
||||||
#define SIG_TONE_MAXBITS 1050 /* as above, maximum bits */
|
#define SIG_TONE_MAXBITS 1050 /* as above, maximum bits */
|
||||||
#define SAT_DURATION 0.100 /* duration of SAT signal measurement */
|
#define SAT_DURATION 0.100 /* duration of SAT signal measurement */
|
||||||
#define SAT_QUALITY 0.85 /* quality needed to detect sat */
|
#define SAT_QUALITY 0.85 /* quality needed to detect sat */
|
||||||
#define SAT_DETECT_COUNT 3 /* number of measures to detect SAT signal (specs say 250ms) */
|
#define SAT_DETECT_COUNT 3 /* number of measures to detect SAT signal (specs say 250ms) */
|
||||||
#define SAT_LOST_COUNT 3 /* number of measures to loose SAT signal (specs say 250ms) */
|
#define SAT_LOST_COUNT 3 /* number of measures to loose SAT signal (specs say 250ms) */
|
||||||
#define SIG_DETECT_COUNT 3 /* number of measures to detect Signalling Tone */
|
#define SIG_DETECT_COUNT 3 /* number of measures to detect Signaling Tone */
|
||||||
#define SIG_LOST_COUNT 2 /* number of measures to loose Signalling Tone */
|
#define SIG_LOST_COUNT 2 /* number of measures to loose Signaling Tone */
|
||||||
#define CUT_OFF_HIGHPASS 300.0 /* cut off frequency for high pass filter to remove dc level from sound card / sample */
|
#define CUT_OFF_HIGHPASS 300.0 /* cut off frequency for high pass filter to remove dc level from sound card / sample */
|
||||||
#define BEST_QUALITY 0.68 /* Best possible RX quality */
|
#define BEST_QUALITY 0.68 /* Best possible RX quality */
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ static double sat_freq[5] = {
|
||||||
6000.0,
|
6000.0,
|
||||||
6030.0,
|
6030.0,
|
||||||
5800.0, /* noise level to check against */
|
5800.0, /* noise level to check against */
|
||||||
10000.0, /* signalling tone */
|
10000.0, /* signaling tone */
|
||||||
};
|
};
|
||||||
|
|
||||||
static int dsp_sine_sat[256];
|
static int dsp_sine_sat[256];
|
||||||
|
@ -652,7 +652,7 @@ void sender_receive_frame(amps_t *amps, int16_t *samples, int length)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* decode signalling tone */
|
/* decode signaling tone */
|
||||||
/* compare supervisory signal against noise floor on 5800 Hz */
|
/* compare supervisory signal against noise floor on 5800 Hz */
|
||||||
static void sat_decode(amps_t *amps, int16_t *samples, int length)
|
static void sat_decode(amps_t *amps, int16_t *samples, int length)
|
||||||
{
|
{
|
||||||
|
@ -661,7 +661,7 @@ static void sat_decode(amps_t *amps, int16_t *samples, int length)
|
||||||
|
|
||||||
coeff[0] = amps->sat_coeff[amps->sat];
|
coeff[0] = amps->sat_coeff[amps->sat];
|
||||||
coeff[1] = amps->sat_coeff[3]; /* noise floor detection */
|
coeff[1] = amps->sat_coeff[3]; /* noise floor detection */
|
||||||
coeff[2] = amps->sat_coeff[4]; /* signalling tone */
|
coeff[2] = amps->sat_coeff[4]; /* signaling tone */
|
||||||
audio_goertzel(samples, length, 0, coeff, result, 3);
|
audio_goertzel(samples, length, 0, coeff, result, 3);
|
||||||
|
|
||||||
quality[0] = (result[0] - result[1]) / result[0];
|
quality[0] = (result[0] - result[1]) / result[0];
|
||||||
|
@ -673,7 +673,7 @@ static void sat_decode(amps_t *amps, int16_t *samples, int length)
|
||||||
|
|
||||||
PDEBUG(DDSP, DEBUG_NOTICE, "SAT level %.2f%% quality %.0f%%\n", result[0] * 32767.0 / SAT_DEVIATION / 0.63662 * 100.0, quality[0] * 100.0);
|
PDEBUG(DDSP, DEBUG_NOTICE, "SAT level %.2f%% quality %.0f%%\n", result[0] * 32767.0 / SAT_DEVIATION / 0.63662 * 100.0, quality[0] * 100.0);
|
||||||
if (amps->sender.loopback || debuglevel == DEBUG_DEBUG) {
|
if (amps->sender.loopback || debuglevel == DEBUG_DEBUG) {
|
||||||
PDEBUG(DDSP, debuglevel, "Signalling Tone level %.2f%% quality %.0f%%\n", result[2] * 32767.0 / FSK_DEVIATION / 0.63662 * 100.0, quality[1] * 100.0);
|
PDEBUG(DDSP, debuglevel, "Signaling Tone level %.2f%% quality %.0f%%\n", result[2] * 32767.0 / FSK_DEVIATION / 0.63662 * 100.0, quality[1] * 100.0);
|
||||||
}
|
}
|
||||||
if (quality[0] > SAT_QUALITY) {
|
if (quality[0] > SAT_QUALITY) {
|
||||||
if (amps->sat_detected == 0) {
|
if (amps->sat_detected == 0) {
|
||||||
|
@ -704,8 +704,8 @@ static void sat_decode(amps_t *amps, int16_t *samples, int length)
|
||||||
if (amps->sig_detect_count == SIG_DETECT_COUNT) {
|
if (amps->sig_detect_count == SIG_DETECT_COUNT) {
|
||||||
amps->sig_detected = 1;
|
amps->sig_detected = 1;
|
||||||
amps->sig_detect_count = 0;
|
amps->sig_detect_count = 0;
|
||||||
PDEBUG(DDSP, DEBUG_DEBUG, "Signalling Tone detected with level=%.0f%%, quality=%.0f%%.\n", result[2] / 0.63662 * 100.0, quality[1] * 100.0);
|
PDEBUG(DDSP, DEBUG_DEBUG, "Signaling Tone detected with level=%.0f%%, quality=%.0f%%.\n", result[2] / 0.63662 * 100.0, quality[1] * 100.0);
|
||||||
amps_rx_signalling_tone(amps, 1, quality[1]);
|
amps_rx_signaling_tone(amps, 1, quality[1]);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
amps->sig_detect_count = 0;
|
amps->sig_detect_count = 0;
|
||||||
|
@ -715,15 +715,15 @@ static void sat_decode(amps_t *amps, int16_t *samples, int length)
|
||||||
if (amps->sig_detect_count == SIG_LOST_COUNT) {
|
if (amps->sig_detect_count == SIG_LOST_COUNT) {
|
||||||
amps->sig_detected = 0;
|
amps->sig_detected = 0;
|
||||||
amps->sig_detect_count = 0;
|
amps->sig_detect_count = 0;
|
||||||
PDEBUG(DDSP, DEBUG_DEBUG, "Signalling Tone lost.\n");
|
PDEBUG(DDSP, DEBUG_DEBUG, "Signaling Tone lost.\n");
|
||||||
amps_rx_signalling_tone(amps, 0, 0.0);
|
amps_rx_signaling_tone(amps, 0, 0.0);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
amps->sig_detect_count = 0;
|
amps->sig_detect_count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* decode signalling/audio */
|
/* decode signaling/audio */
|
||||||
/* Count SIG_TONE_CROSSINGS of zero crossings, then check if the elapsed bit
|
/* Count SIG_TONE_CROSSINGS of zero crossings, then check if the elapsed bit
|
||||||
* time is between SIG_TONE_MINBITS and SIG_TONE_MAXBITS. If it is, the
|
* time is between SIG_TONE_MINBITS and SIG_TONE_MAXBITS. If it is, the
|
||||||
* frequency is close to the singalling tone, so it is detected
|
* frequency is close to the singalling tone, so it is detected
|
||||||
|
|
|
@ -322,7 +322,7 @@ int main(int argc, char *argv[])
|
||||||
fprintf(stderr, "*******************************************************************************\n");
|
fprintf(stderr, "*******************************************************************************\n");
|
||||||
fprintf(stderr, "I strongly suggest to let me do pre- and de-emphasis (options -E -e)!\n");
|
fprintf(stderr, "I strongly suggest to let me do pre- and de-emphasis (options -E -e)!\n");
|
||||||
fprintf(stderr, "Use a transmitter/receiver without emphasis and let me do that!\n");
|
fprintf(stderr, "Use a transmitter/receiver without emphasis and let me do that!\n");
|
||||||
fprintf(stderr, "Because carrier FSK signalling does not use emphasis, I like to control\n");
|
fprintf(stderr, "Because carrier FSK signaling does not use emphasis, I like to control\n");
|
||||||
fprintf(stderr, "emphasis by myself for best results.\n");
|
fprintf(stderr, "emphasis by myself for best results.\n");
|
||||||
fprintf(stderr, "*******************************************************************************\n");
|
fprintf(stderr, "*******************************************************************************\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,8 @@ enum amps_trans_state {
|
||||||
TRANS_CALL_MO_ASSIGN_SEND, /* assigning channel, sending assignment */
|
TRANS_CALL_MO_ASSIGN_SEND, /* assigning channel, sending assignment */
|
||||||
TRANS_CALL_MT_ASSIGN, /* assigning channel, waiting to send */
|
TRANS_CALL_MT_ASSIGN, /* assigning channel, waiting to send */
|
||||||
TRANS_CALL_MT_ASSIGN_SEND, /* assigning channel, sending assignment */
|
TRANS_CALL_MT_ASSIGN_SEND, /* assigning channel, sending assignment */
|
||||||
TRANS_CALL_MT_ALERT, /* ringing the phone, sending alert order until signalling tone is received */
|
TRANS_CALL_MT_ALERT, /* ringing the phone, sending alert order until signaling tone is received */
|
||||||
TRANS_CALL_MT_ALERT_SEND, /* ringing the phone, signalling tone is received */
|
TRANS_CALL_MT_ALERT_SEND, /* ringing the phone, signaling tone is received */
|
||||||
TRANS_CALL_REJECT, /* rejecting channel, waiting to send */
|
TRANS_CALL_REJECT, /* rejecting channel, waiting to send */
|
||||||
TRANS_CALL_REJECT_SEND, /* rejecting channel, sending reject */
|
TRANS_CALL_REJECT_SEND, /* rejecting channel, sending reject */
|
||||||
TRANS_CALL, /* active call */
|
TRANS_CALL, /* active call */
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
|
|
||||||
#define PI 3.1415927
|
#define PI 3.1415927
|
||||||
|
|
||||||
/* signalling */
|
/* signaling */
|
||||||
/* NOTE: The peak deviation is similar for paging tone and signalling tone,
|
/* NOTE: The peak deviation is similar for paging tone and signaling tone,
|
||||||
* so both tones should be equal after pre-emphasis. This is why the paging
|
* so both tones should be equal after pre-emphasis. This is why the paging
|
||||||
* tones is so much louder.*/
|
* tones is so much louder.*/
|
||||||
#define TX_PEAK_TONE 8192.0 /* peak amplitude for all tones */
|
#define TX_PEAK_TONE 8192.0 /* peak amplitude for all tones */
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
extern int page_sequence;
|
extern int page_sequence;
|
||||||
|
|
||||||
/* two signalling tones */
|
/* two signaling tones */
|
||||||
static double fsk_tones[2] = {
|
static double fsk_tones[2] = {
|
||||||
2280.0,
|
2280.0,
|
||||||
1750.0,
|
1750.0,
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
#define PI 3.1415927
|
#define PI 3.1415927
|
||||||
|
|
||||||
/* signalling */
|
/* signaling */
|
||||||
#define TX_PEAK_TONE 5000.0 /* peak amplitude for all tones */
|
#define TX_PEAK_TONE 5000.0 /* peak amplitude for all tones */
|
||||||
#define BIT_DURATION 0.010 /* bit length: 10 ms */
|
#define BIT_DURATION 0.010 /* bit length: 10 ms */
|
||||||
#define FILTER_STEP 0.001 /* step every 1 ms */
|
#define FILTER_STEP 0.001 /* step every 1 ms */
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
#define LOSS_INTERVAL 1000 /* filter steps (milliseconds) for one second interval */
|
#define LOSS_INTERVAL 1000 /* filter steps (milliseconds) for one second interval */
|
||||||
#define LOSS_TIME 12 /* duration of signal loss before release */
|
#define LOSS_TIME 12 /* duration of signal loss before release */
|
||||||
|
|
||||||
/* two signalling tones */
|
/* two signaling tones */
|
||||||
static double fsk_bits[2] = {
|
static double fsk_bits[2] = {
|
||||||
2070.0,
|
2070.0,
|
||||||
1950.0,
|
1950.0,
|
||||||
|
|
|
@ -757,12 +757,12 @@ const telegramm_t *cnetz_transmit_telegramm_rufblock(cnetz_t *cnetz)
|
||||||
telegramm.futln_rest_nr = trans->futln_rest;
|
telegramm.futln_rest_nr = trans->futln_rest;
|
||||||
switch (trans->state) {
|
switch (trans->state) {
|
||||||
case TRANS_EM:
|
case TRANS_EM:
|
||||||
PDEBUG(DCNETZ, DEBUG_INFO, "Sending acknowledgement 'Einbuchquittung' to Attachment request.\n");
|
PDEBUG(DCNETZ, DEBUG_INFO, "Sending acknowledgment 'Einbuchquittung' to Attachment request.\n");
|
||||||
telegramm.opcode = OPCODE_EBQ_R;
|
telegramm.opcode = OPCODE_EBQ_R;
|
||||||
destroy_transaction(trans);
|
destroy_transaction(trans);
|
||||||
break;
|
break;
|
||||||
case TRANS_UM:
|
case TRANS_UM:
|
||||||
PDEBUG(DCNETZ, DEBUG_INFO, "Sending acknowledgement 'Umbuchquittung' to Roaming requuest.\n");
|
PDEBUG(DCNETZ, DEBUG_INFO, "Sending acknowledgment 'Umbuchquittung' to Roaming requuest.\n");
|
||||||
telegramm.opcode = OPCODE_UBQ_R;
|
telegramm.opcode = OPCODE_UBQ_R;
|
||||||
destroy_transaction(trans);
|
destroy_transaction(trans);
|
||||||
break;
|
break;
|
||||||
|
@ -851,7 +851,7 @@ const telegramm_t *cnetz_transmit_telegramm_meldeblock(cnetz_t *cnetz)
|
||||||
if (trans) {
|
if (trans) {
|
||||||
switch (trans->state) {
|
switch (trans->state) {
|
||||||
case TRANS_VWG:
|
case TRANS_VWG:
|
||||||
PDEBUG(DCNETZ, DEBUG_INFO, "Sending acknowledgement 'Wahlaufforderung' to outging call\n");
|
PDEBUG(DCNETZ, DEBUG_INFO, "Sending acknowledgment 'Wahlaufforderung' to outging call\n");
|
||||||
telegramm.opcode = OPCODE_WAF_M;
|
telegramm.opcode = OPCODE_WAF_M;
|
||||||
telegramm.futln_nationalitaet = trans->futln_nat;
|
telegramm.futln_nationalitaet = trans->futln_nat;
|
||||||
telegramm.futln_heimat_fuvst_nr = trans->futln_fuvst;
|
telegramm.futln_heimat_fuvst_nr = trans->futln_fuvst;
|
||||||
|
|
|
@ -30,12 +30,12 @@ enum cnetz_state {
|
||||||
|
|
||||||
/* timers */
|
/* timers */
|
||||||
#define F_BQ 8 /* number of not received frames at BQ state */
|
#define F_BQ 8 /* number of not received frames at BQ state */
|
||||||
#define F_VHQK 16 /* number of not received frames at VHQ state during concentrated signalling */
|
#define F_VHQK 16 /* number of not received frames at VHQ state during concentrated signaling */
|
||||||
#define F_VHQ 16 /* number of not received frames at VHQ state during distributed signalling */
|
#define F_VHQ 16 /* number of not received frames at VHQ state during distributed signaling */
|
||||||
#define F_DS 16 /* number of not received frames at DS state */
|
#define F_DS 16 /* number of not received frames at DS state */
|
||||||
#define F_RTA 16 /* number of not received frames at RTA state */
|
#define F_RTA 16 /* number of not received frames at RTA state */
|
||||||
#define N_AFKT 6 /* number of release frames to send during concentrated signalling */
|
#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 signalling */
|
#define N_AFV 4 /* number of release frames to send during distributed signaling */
|
||||||
|
|
||||||
/* clear causes */
|
/* clear causes */
|
||||||
#define CNETZ_CAUSE_TEILNEHMERBESETZT 0 /* subscriber busy */
|
#define CNETZ_CAUSE_TEILNEHMERBESETZT 0 /* subscriber busy */
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
*
|
*
|
||||||
* To determine a change from noise, we use a theshold. This is set to half of
|
* To determine a change from noise, we use a theshold. This is set to half of
|
||||||
* the level of last received change. This means that the next change may be
|
* the level of last received change. This means that the next change may be
|
||||||
* down to a half lower. There is a special case during distributed signalling.
|
* down to a half lower. There is a special case during distributed signaling.
|
||||||
* The first level change of each data chunk raises or falls from 0-level
|
* The first level change of each data chunk raises or falls from 0-level
|
||||||
* (unmodulated carrier), so the threshold for this bit is only a quarter of the
|
* (unmodulated carrier), so the threshold for this bit is only a quarter of the
|
||||||
* last received change.
|
* last received change.
|
||||||
|
@ -418,7 +418,7 @@ void fsk_fm_demod(fsk_fm_demod_t *fsk, int16_t *samples, int length)
|
||||||
bit_time_uncorrected = fsk->bit_time_uncorrected;
|
bit_time_uncorrected = fsk->bit_time_uncorrected;
|
||||||
bit_count = fsk->bit_count;
|
bit_count = fsk->bit_count;
|
||||||
|
|
||||||
/* process signalling block, sample by sample */
|
/* process signaling block, sample by sample */
|
||||||
for (i = 0; i < length; i++) {
|
for (i = 0; i < length; i++) {
|
||||||
spl[pos++] = samples[i];
|
spl[pos++] = samples[i];
|
||||||
if (pos == len)
|
if (pos == len)
|
||||||
|
@ -431,7 +431,7 @@ void fsk_fm_demod(fsk_fm_demod_t *fsk, int16_t *samples, int length)
|
||||||
#endif
|
#endif
|
||||||
find_change(fsk);
|
find_change(fsk);
|
||||||
} else {
|
} else {
|
||||||
/* in distributed signalling, measure over 5 bits, but ignore 5th bit.
|
/* in distributed signaling, measure over 5 bits, but ignore 5th bit.
|
||||||
* also reset next_bit, as soon as we reach the window */
|
* also reset next_bit, as soon as we reach the window */
|
||||||
|
|
||||||
/* note that we start from 0.5, because we detect change 0.5 bits later,
|
/* note that we start from 0.5, because we detect change 0.5 bits later,
|
||||||
|
|
|
@ -27,7 +27,7 @@ typedef struct fsk_fm_demod {
|
||||||
int level_threshold; /* threshold for detection of next level change */
|
int level_threshold; /* threshold for detection of next level change */
|
||||||
double bits_per_sample; /* duration of one sample in bits */
|
double bits_per_sample; /* duration of one sample in bits */
|
||||||
double next_bit; /* count time to detect bits */
|
double next_bit; /* count time to detect bits */
|
||||||
int bit_count; /* counts bits, to match 4 bits at distributed signalling */
|
int bit_count; /* counts bits, to match 4 bits at distributed signaling */
|
||||||
int last_change_positive; /* flags last level change direction */
|
int last_change_positive; /* flags last level change direction */
|
||||||
enum fsk_sync sync; /* set, if we are in sync and what polarity we receive */
|
enum fsk_sync sync; /* set, if we are in sync and what polarity we receive */
|
||||||
double sync_level; /* what was the level, when we received the sync */
|
double sync_level; /* what was the level, when we received the sync */
|
||||||
|
|
|
@ -276,7 +276,7 @@ int main(int argc, char *argv[])
|
||||||
fprintf(stderr, "*******************************************************************************\n");
|
fprintf(stderr, "*******************************************************************************\n");
|
||||||
fprintf(stderr, "I strongly suggest to let me do pre- and de-emphasis (options -E -e)!\n");
|
fprintf(stderr, "I strongly suggest to let me do pre- and de-emphasis (options -E -e)!\n");
|
||||||
fprintf(stderr, "Use a transmitter/receiver without emphasis and let me do that!\n");
|
fprintf(stderr, "Use a transmitter/receiver without emphasis and let me do that!\n");
|
||||||
fprintf(stderr, "Because carrier FSK signalling and scrambled voice (default) does not use\n");
|
fprintf(stderr, "Because carrier FSK signaling and scrambled voice (default) does not use\n");
|
||||||
fprintf(stderr, "emphasis, I like to control emphasis by myself for best results.\n");
|
fprintf(stderr, "emphasis, I like to control emphasis by myself for best results.\n");
|
||||||
fprintf(stderr, "*******************************************************************************\n");
|
fprintf(stderr, "*******************************************************************************\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1522,7 +1522,7 @@ selected:
|
||||||
switch (cnetz->dsp_mode) {
|
switch (cnetz->dsp_mode) {
|
||||||
case DSP_MODE_OGK:
|
case DSP_MODE_OGK:
|
||||||
if (definition_opcode[opcode].block != BLOCK_R && definition_opcode[opcode].block != BLOCK_M) {
|
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 signalling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm that is not used OgK channel signaling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* determine block by last timeslot sent and by message type */
|
/* determine block by last timeslot sent and by message type */
|
||||||
|
@ -1533,14 +1533,14 @@ selected:
|
||||||
break;
|
break;
|
||||||
case DSP_MODE_SPK_K:
|
case DSP_MODE_SPK_K:
|
||||||
if (definition_opcode[opcode].block != BLOCK_K) {
|
if (definition_opcode[opcode].block != BLOCK_K) {
|
||||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm that is not used for concentrated signalling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm that is not used for concentrated signaling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cnetz_receive_telegramm_spk_k(cnetz, &telegramm);
|
cnetz_receive_telegramm_spk_k(cnetz, &telegramm);
|
||||||
break;
|
break;
|
||||||
case DSP_MODE_SPK_V:
|
case DSP_MODE_SPK_V:
|
||||||
if (definition_opcode[opcode].block != BLOCK_V) {
|
if (definition_opcode[opcode].block != BLOCK_V) {
|
||||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm that is not used for distributed signalling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
PDEBUG(DFRAME, DEBUG_NOTICE, "Received Telegramm that is not used for distributed signaling, ignoring! (opcode %d = %s)\n", opcode, definition_opcode[opcode].message_name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cnetz_receive_telegramm_spk_v(cnetz, &telegramm);
|
cnetz_receive_telegramm_spk_v(cnetz, &telegramm);
|
||||||
|
|
|
@ -124,7 +124,7 @@ enum gsm48_bcap_ra {
|
||||||
GSM48_BCAP_RA_OTHER = 3,
|
GSM48_BCAP_RA_OTHER = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* GSM 04.08 Bearer Capability: Signalling access protocol */
|
/* GSM 04.08 Bearer Capability: Signaling access protocol */
|
||||||
enum gsm48_bcap_sig_access {
|
enum gsm48_bcap_sig_access {
|
||||||
GSM48_BCAP_SA_I440_I450 = 1,
|
GSM48_BCAP_SA_I440_I450 = 1,
|
||||||
GSM48_BCAP_SA_X21 = 2,
|
GSM48_BCAP_SA_X21 = 2,
|
||||||
|
|
|
@ -31,9 +31,9 @@
|
||||||
|
|
||||||
#define PI M_PI
|
#define PI M_PI
|
||||||
|
|
||||||
/* signalling */
|
/* signaling */
|
||||||
#define COMPANDOR_0DB 32767 /* works quite well */
|
#define COMPANDOR_0DB 32767 /* works quite well */
|
||||||
#define TX_PEAK_FSK 10000.0 /* peak amplitude of signalling FSK */
|
#define TX_PEAK_FSK 10000.0 /* peak amplitude of signaling FSK */
|
||||||
#define TX_PEAK_SUPER 1000.0 /* peak amplitude of supervisory signal */
|
#define TX_PEAK_SUPER 1000.0 /* peak amplitude of supervisory signal */
|
||||||
#define BIT_RATE 1200 /* baud rate */
|
#define BIT_RATE 1200 /* baud rate */
|
||||||
#define STEPS_PER_BIT 10 /* step every 1/12000 sec */
|
#define STEPS_PER_BIT 10 /* step every 1/12000 sec */
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
#define SUPER_DETECT_COUNT 4 /* number of measures to detect supervisory signal */
|
#define SUPER_DETECT_COUNT 4 /* number of measures to detect supervisory signal */
|
||||||
#define MUTE_DURATION 0.280 /* a tiny bit more than two frames */
|
#define MUTE_DURATION 0.280 /* a tiny bit more than two frames */
|
||||||
|
|
||||||
/* two signalling tones */
|
/* two signaling tones */
|
||||||
static double fsk_bits[2] = {
|
static double fsk_bits[2] = {
|
||||||
1800.0,
|
1800.0,
|
||||||
1200.0,
|
1200.0,
|
||||||
|
|
|
@ -215,14 +215,14 @@ static struct nmt_frame {
|
||||||
{ NMT_MESSAGE_6, "JJJPJJJJJJJJJJJJ", MTX_TO_XX, 0, "6", "Idle frame" },
|
{ NMT_MESSAGE_6, "JJJPJJJJJJJJJJJJ", MTX_TO_XX, 0, "6", "Idle frame" },
|
||||||
{ NMT_MESSAGE_7, "NNNPYYCCCCCCCJJJ", MTX_TO_MS, 8, "7", "Authentication request" },
|
{ NMT_MESSAGE_7, "NNNPYYCCCCCCCJJJ", MTX_TO_MS, 8, "7", "Authentication request" },
|
||||||
{ NMT_MESSAGE_8, "NNNPYYMHHHHHHHWW", MTX_TO_MS, 1, "8", "A-subscriber number" },
|
{ NMT_MESSAGE_8, "NNNPYYMHHHHHHHWW", MTX_TO_MS, 1, "8", "A-subscriber number" },
|
||||||
{ NMT_MESSAGE_10a, "NNNPZXXXXXXTJJJJ", MS_TO_MTX, 1, "10a", "Call acknowledgement from MS on calling channel (shortened frame)" },
|
{ NMT_MESSAGE_10a, "NNNPZXXXXXXTJJJJ", MS_TO_MTX, 1, "10a", "Call acknowledgment from MS on calling channel (shortened frame)" },
|
||||||
{ NMT_MESSAGE_10b, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 1, "10b", "Seizure from ordinary MS and identity on traffic channel" },
|
{ NMT_MESSAGE_10b, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 1, "10b", "Seizure from ordinary MS and identity on traffic channel" },
|
||||||
{ NMT_MESSAGE_10c, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 6, "10c", "Seizure and identity from called MS on traffic channel" },
|
{ NMT_MESSAGE_10c, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 6, "10c", "Seizure and identity from called MS on traffic channel" },
|
||||||
{ NMT_MESSAGE_11a, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 14, "11a", "Roaming updating seizure and identity on traffic channel" },
|
{ NMT_MESSAGE_11a, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 14, "11a", "Roaming updating seizure and identity on traffic channel" },
|
||||||
{ NMT_MESSAGE_11b, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 15, "11b", "Seizure and call achnowledgement on calling channel from MS with priority (shortened frame)" },
|
{ NMT_MESSAGE_11b, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 15, "11b", "Seizure and call achnowledgment on calling channel from MS with priority (shortened frame)" },
|
||||||
{ NMT_MESSAGE_12, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 11, "12", "Seizure from coin-box on traffic channel" },
|
{ NMT_MESSAGE_12, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 11, "12", "Seizure from coin-box on traffic channel" },
|
||||||
{ NMT_MESSAGE_13a, "NNNPZXXXXXXLLLLL", MS_TO_MTX, 8, "13a", "Line signal" },
|
{ NMT_MESSAGE_13a, "NNNPZXXXXXXLLLLL", MS_TO_MTX, 8, "13a", "Line signal" },
|
||||||
{ NMT_MESSAGE_13b, "NNNPZXXXXXXLLLQQ", MS_TO_MTX, 8, "13b", "Line signal: Answer acknowledgement from coin box" },
|
{ NMT_MESSAGE_13b, "NNNPZXXXXXXLLLQQ", MS_TO_MTX, 8, "13b", "Line signal: Answer acknowledgment from coin box" },
|
||||||
{ NMT_MESSAGE_14a, "NNNPZXXXXXXSSSSS", MS_TO_MTX, 7, "14a", "Digit signal (1st, 3rd, 5th ........digit)" },
|
{ NMT_MESSAGE_14a, "NNNPZXXXXXXSSSSS", MS_TO_MTX, 7, "14a", "Digit signal (1st, 3rd, 5th ........digit)" },
|
||||||
{ NMT_MESSAGE_14b, "NNNPZXXXXXXSSSSS", MS_TO_MTX, 7, "14b", "Digit signal (2nd, 4th, 6th ........digit)" },
|
{ NMT_MESSAGE_14b, "NNNPZXXXXXXSSSSS", MS_TO_MTX, 7, "14b", "Digit signal (2nd, 4th, 6th ........digit)" },
|
||||||
{ NMT_MESSAGE_15, "JJJPJJJJJJJJJJJJ", XX_TO_MTX, 0, "15", "Idle frame" },
|
{ NMT_MESSAGE_15, "JJJPJJJJJJJJJJJJ", XX_TO_MTX, 0, "15", "Idle frame" },
|
||||||
|
@ -383,7 +383,7 @@ static const char *param_line_signal(uint64_t value, int ndigits, enum nmt_direc
|
||||||
desc = "Clearing, release guard";
|
desc = "Clearing, release guard";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
desc = "Answer acknowledgement, (coin-box)";
|
desc = "Answer acknowledgment, (coin-box)";
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
desc = "Register recall ";
|
desc = "Register recall ";
|
||||||
|
|
|
@ -963,12 +963,12 @@ static void tx_mt_paging(nmt_t *nmt, frame_t *frame)
|
||||||
static void rx_mt_paging(nmt_t *nmt, frame_t *frame)
|
static void rx_mt_paging(nmt_t *nmt, frame_t *frame)
|
||||||
{
|
{
|
||||||
switch (frame->mt) {
|
switch (frame->mt) {
|
||||||
case NMT_MESSAGE_10a: /* call acknowledgement */
|
case NMT_MESSAGE_10a: /* call acknowledgment */
|
||||||
if (!match_channel(nmt, frame))
|
if (!match_channel(nmt, frame))
|
||||||
break;
|
break;
|
||||||
if (!match_subscriber(nmt, frame))
|
if (!match_subscriber(nmt, frame))
|
||||||
break;
|
break;
|
||||||
PDEBUG(DNMT, DEBUG_INFO, "Received call acknowledgement on channel %d.\n", nmt->sender.kanal);
|
PDEBUG(DNMT, DEBUG_INFO, "Received call acknowledgment on channel %d.\n", nmt->sender.kanal);
|
||||||
nmt_new_state(nmt, STATE_MT_CHANNEL);
|
nmt_new_state(nmt, STATE_MT_CHANNEL);
|
||||||
nmt->tx_frame_count = 0;
|
nmt->tx_frame_count = 0;
|
||||||
if (nmt->page_for_nmt) {
|
if (nmt->page_for_nmt) {
|
||||||
|
|
Loading…
Reference in New Issue