Add clock function to call interface
Implementations will have a clock to play tones, if no clock is available from a transceiver.
This commit is contained in:
parent
0cfcf67157
commit
f132059edf
|
@ -1076,6 +1076,8 @@ void call_down_audio(int callref, sample_t *samples, int count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void call_down_clock(void) {}
|
||||||
|
|
||||||
/* Timeout handling */
|
/* Timeout handling */
|
||||||
void transaction_timeout(struct timer *timer)
|
void transaction_timeout(struct timer *timer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -540,5 +540,7 @@ void call_down_audio(int callref, sample_t *samples, int count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void call_down_clock(void) {}
|
||||||
|
|
||||||
void dump_info(void) {}
|
void dump_info(void) {}
|
||||||
|
|
||||||
|
|
|
@ -862,5 +862,7 @@ void call_down_audio(int callref, sample_t *samples, int count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void call_down_clock(void) {}
|
||||||
|
|
||||||
void dump_info(void) {}
|
void dump_info(void) {}
|
||||||
|
|
||||||
|
|
|
@ -560,6 +560,8 @@ void call_down_audio(int callref, sample_t *samples, int count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void call_down_clock(void) {}
|
||||||
|
|
||||||
int call_down_setup(int callref, const char __attribute__((unused)) *caller_id, enum number_type __attribute__((unused)) caller_type, const char *dialing)
|
int call_down_setup(int callref, const char __attribute__((unused)) *caller_id, enum number_type __attribute__((unused)) caller_type, const char *dialing)
|
||||||
{
|
{
|
||||||
sender_t *sender;
|
sender_t *sender;
|
||||||
|
|
|
@ -265,13 +265,6 @@ void sender_receive(sender_t *sender, sample_t *samples, int length, double __at
|
||||||
|
|
||||||
if (euro->rx)
|
if (euro->rx)
|
||||||
tone_decode(euro, down, count);
|
tone_decode(euro, down, count);
|
||||||
|
|
||||||
/* whenever a chunk of anouncement audio should be played toward caller */
|
|
||||||
euro->chunk_count += count;
|
|
||||||
if (euro->chunk_count >= 160) {
|
|
||||||
euro->chunk_count -= 160;
|
|
||||||
euro_clock_chunk(sender);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate tone of paging digits. */
|
/* Generate tone of paging digits. */
|
||||||
|
|
|
@ -525,31 +525,34 @@ static void call_play_beep(euro_call_t *call)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop through all calls and play the announcement */
|
/* loop through all calls and play the announcement */
|
||||||
void euro_clock_chunk(sender_t *sender)
|
void call_down_clock(void)
|
||||||
{
|
{
|
||||||
|
sender_t *sender;
|
||||||
euro_t *euro;
|
euro_t *euro;
|
||||||
euro_call_t *call;
|
euro_call_t *call;
|
||||||
|
|
||||||
if (sender == sender_head) {
|
/* clock all calls without a transceiver */
|
||||||
/* use first tranceiver clock to clock calls without a transceiver */
|
for (call = ooo_call_list; call; call = call->next) {
|
||||||
for (call = ooo_call_list; call; call = call->next) {
|
|
||||||
/* no callref */
|
|
||||||
if (!call->callref)
|
|
||||||
continue;
|
|
||||||
/* beep or announcement */
|
|
||||||
if (call->state == EURO_CALL_BEEPING)
|
|
||||||
call_play_beep(call);
|
|
||||||
else
|
|
||||||
call_play_announcement(call);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
euro = (euro_t *) sender;
|
|
||||||
for (call = euro->call_list; call; call = call->next) {
|
|
||||||
/* no callref */
|
/* no callref */
|
||||||
if (!call->callref)
|
if (!call->callref)
|
||||||
continue;
|
continue;
|
||||||
/* announcement */
|
/* beep or announcement */
|
||||||
call_play_announcement(call);
|
if (call->state == EURO_CALL_BEEPING)
|
||||||
|
call_play_beep(call);
|
||||||
|
else
|
||||||
|
call_play_announcement(call);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* clock all calls that have a transceiver */
|
||||||
|
for (sender = sender_head; sender; sender = sender->next) {
|
||||||
|
euro = (euro_t *) sender;
|
||||||
|
for (call = euro->call_list; call; call = call->next) {
|
||||||
|
/* no callref */
|
||||||
|
if (!call->callref)
|
||||||
|
continue;
|
||||||
|
/* announcement */
|
||||||
|
call_play_announcement(call);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,6 @@ typedef struct eurosignal {
|
||||||
double tx_time; /* current elapsed time of tone */
|
double tx_time; /* current elapsed time of tone */
|
||||||
char tx_digits[7]; /* current ID beeing transmitted */
|
char tx_digits[7]; /* current ID beeing transmitted */
|
||||||
int tx_digit_index; /* current digit beein transmitted */
|
int tx_digit_index; /* current digit beein transmitted */
|
||||||
int chunk_count; /* current elapsed sample of 20ms audio chunk */
|
|
||||||
fm_demod_t rx_demod; /* demodulator for frequency */
|
fm_demod_t rx_demod; /* demodulator for frequency */
|
||||||
iir_filter_t rx_lp; /* low pass to filter the frequency result */
|
iir_filter_t rx_lp; /* low pass to filter the frequency result */
|
||||||
int rx_digit_count; /* count the tone until detected */
|
int rx_digit_count; /* count the tone until detected */
|
||||||
|
@ -87,5 +86,4 @@ int euro_create(const char *kanal, const char *audiodev, int use_sdr, int sample
|
||||||
void euro_destroy(sender_t *sender);
|
void euro_destroy(sender_t *sender);
|
||||||
void euro_get_id(euro_t *euro, char *id);
|
void euro_get_id(euro_t *euro, char *id);
|
||||||
void euro_receive_id(euro_t *euro, char *id);
|
void euro_receive_id(euro_t *euro, char *id);
|
||||||
void euro_clock_chunk(sender_t *sender);
|
|
||||||
|
|
||||||
|
|
|
@ -1322,5 +1322,7 @@ void call_down_audio(int callref, sample_t *samples, int count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void call_down_clock(void) {}
|
||||||
|
|
||||||
void dump_info(void) {}
|
void dump_info(void) {}
|
||||||
|
|
||||||
|
|
|
@ -632,5 +632,7 @@ void call_down_audio(int callref, sample_t *samples, int count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void call_down_clock(void) {}
|
||||||
|
|
||||||
void dump_info(void) {}
|
void dump_info(void) {}
|
||||||
|
|
||||||
|
|
|
@ -586,6 +586,8 @@ void call_clock(void)
|
||||||
uint8_t buf[sizeof(struct gsm_data_frame) + 160 * sizeof(int16_t)];
|
uint8_t buf[sizeof(struct gsm_data_frame) + 160 * sizeof(int16_t)];
|
||||||
struct gsm_data_frame *data = (struct gsm_data_frame *)buf;
|
struct gsm_data_frame *data = (struct gsm_data_frame *)buf;
|
||||||
|
|
||||||
|
call_down_clock();
|
||||||
|
|
||||||
while(process) {
|
while(process) {
|
||||||
if (process->pattern != PATTERN_NONE) {
|
if (process->pattern != PATTERN_NONE) {
|
||||||
data->msg_type = ANALOG_8000HZ;
|
data->msg_type = ANALOG_8000HZ;
|
||||||
|
|
|
@ -36,5 +36,6 @@ void call_up_audio(int callref, sample_t *samples, int count);
|
||||||
void call_down_audio(int callref, sample_t *samples, int count);
|
void call_down_audio(int callref, sample_t *samples, int count);
|
||||||
|
|
||||||
/* clock to transmit to */
|
/* clock to transmit to */
|
||||||
void call_clock(void);
|
void call_clock(void); /* from main loop */
|
||||||
|
void call_down_clock(void); /* towards mobile implementation */
|
||||||
|
|
||||||
|
|
|
@ -1905,6 +1905,8 @@ void call_down_audio(int callref, sample_t *samples, int count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void call_down_clock(void) {}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SMS layer messages
|
* SMS layer messages
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1582,5 +1582,7 @@ void call_down_audio(int callref, sample_t *samples, int count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void call_down_clock(void) {}
|
||||||
|
|
||||||
void dump_info(void) {}
|
void dump_info(void) {}
|
||||||
|
|
||||||
|
|
|
@ -253,5 +253,7 @@ int main(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void call_down_clock(void) {}
|
||||||
|
|
||||||
void print_image(void) {}
|
void print_image(void) {}
|
||||||
|
|
||||||
|
|
|
@ -162,5 +162,7 @@ int main(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void call_down_clock(void) {}
|
||||||
|
|
||||||
void print_image(void) {}
|
void print_image(void) {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue