aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/sender.c
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2017-08-19 12:27:05 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2017-09-01 18:42:46 +0200
commit743d147d1672837595ae1d6aa024522f4a011614 (patch)
tree50c44e565e00700d90338835e681cbb1dccf8e9b /src/common/sender.c
parent1c2e9180a2db989f26c5cff01eaa6ef12bb45011 (diff)
SDR: Turn TX power off if requested by network
The power level is ramped smoothly within 1 ms up or down. R2000, AMPS and C-Netz turn off power when voice channel is not i use. C-Netz turns off power between OgK timeslots.
Diffstat (limited to 'src/common/sender.c')
-rw-r--r--src/common/sender.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/sender.c b/src/common/sender.c
index e9d0690..823fd5c 100644
--- a/src/common/sender.c
+++ b/src/common/sender.c
@@ -298,10 +298,12 @@ void process_sender_audio(sender_t *sender, int *quit, int latspl)
/* count instances for audio channel */
for (num_chan = 0, inst = sender; inst; num_chan++, inst = inst->slave);
sample_t buff[num_chan][latspl], *samples[num_chan];
+ uint8_t pbuff[num_chan][latspl], *power[num_chan];
enum paging_signal paging_signal[num_chan];
int on[num_chan];
for (i = 0; i < num_chan; i++) {
samples[i] = buff[i];
+ power[i] = pbuff[i];
}
#ifdef DEBUG_TIME_CONSUMPTION
@@ -334,7 +336,7 @@ cant_recover:
if (inst->loopback == 3)
jitter_load(&inst->dejitter, samples[i], count);
else
- sender_send(inst, samples[i], count);
+ sender_send(inst, samples[i], power[i], count);
/* internal loopback: loop back TX audio to RX */
if (inst->loopback == 1) {
display_wave(inst, samples[i], count, inst->max_display);
@@ -358,7 +360,7 @@ cant_recover:
if (sender->wave_tx_play.fp)
wave_read(&sender->wave_tx_play, samples, count);
- rc = sender->audio_write(sender->audio, samples, count, paging_signal, on, num_chan);
+ rc = sender->audio_write(sender->audio, samples, power, count, paging_signal, on, num_chan);
if (rc < 0) {
PDEBUG(DSENDER, DEBUG_ERROR, "Failed to write TX data to audio device (rc = %d)\n", rc);
if (rc == -EPIPE) {