aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-04-27 23:17:14 +0000
committerNeels Hofmeyr <neels@hofmeyr.de>2021-05-27 17:06:21 +0200
commit0951d756655d7c637efd450d125f7a9ae38098eb (patch)
tree9fbb7624307603e47d0856c8a0594a2981ac5dff /tests
parentd587574d7b9613f2cc733aa4a82d5a9c6f068193 (diff)
make sure channel mode and s15_s0 are updated only after an ACK
I noticed during testing that an lchan used as TCH/F in fact still had its channel mode set to Signalling -- because on Assignment, the Speech mode used to be placed in the *previous* lchan and the new lchan was never updated after the Activ ACK. This is unbearable confusion which I complained about numerous times, so far mostly for cosmetic reasons. But implementing re-assignment properly actually requires this to be cleaned up. Keep all volatile chan mode settings in lchan->activate.* or lchan->modify.*, and only update lchan->* members when an ACK has been received for those settings. So a failed request keeps a sane state. Make sure that those settings are in fact updated in the proper lchan, upon an ACK, so that subsequent re-assignment or mode-modify know the accurate lchan state. Related are upcoming patches that sort out the AMR multirate configuration in a similar fashion, see Iebac2dc26412d877e5364f90d6f2ed7a7952351e Ia7519d2fa9e7f0b61b222d27d077bde4660c40b9 Ie57f9d0e3912632903d9740291225bfd1634ed47. Related: SYS#5315 OS#4940 OS#3787 OS#3833 Change-Id: Ie0da36124d73efc28a8809b63d7c96e2167fc412
Diffstat (limited to 'tests')
-rw-r--r--tests/handover/handover_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 2b8e8775b..c16b26dcc 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -397,14 +397,14 @@ struct gsm_lchan *lchan_act(struct gsm_lchan *lchan, int full_rate, const char *
create_conn(lchan);
if (!strcasecmp(codec, "FR") && full_rate)
- lchan->tch_mode = GSM48_CMODE_SPEECH_V1;
+ lchan->current_ch_mode_rate.chan_mode = GSM48_CMODE_SPEECH_V1;
else if (!strcasecmp(codec, "HR") && !full_rate)
- lchan->tch_mode = GSM48_CMODE_SPEECH_V1;
+ lchan->current_ch_mode_rate.chan_mode = GSM48_CMODE_SPEECH_V1;
else if (!strcasecmp(codec, "EFR") && full_rate)
- lchan->tch_mode = GSM48_CMODE_SPEECH_EFR;
+ lchan->current_ch_mode_rate.chan_mode = GSM48_CMODE_SPEECH_EFR;
else if (!strcasecmp(codec, "AMR")) {
- lchan->tch_mode = GSM48_CMODE_SPEECH_AMR;
- lchan->activate.info.s15_s0 = 0x0002;
+ lchan->current_ch_mode_rate.chan_mode = GSM48_CMODE_SPEECH_AMR;
+ lchan->current_ch_mode_rate.s15_s0 = 0x0002;
} else {
fprintf(stderr, "Given codec unknown\n");
exit(EXIT_FAILURE);