measurement: fix expected number of measurements

The logic in measurement.c checks the amount of collected measurement
values. This is done for the total amount of measurements and the amount
of SUB blocks measurements.

The functions that return the expected number of measurement values
currently do not take into account that the mode of a TCH/F or TCH/H has
an effect on the number of expected SUB blocks. (In signalling channels
all blocks count as SUB). Also a TCH/H in signalling mode generates only
half the amount of measurements because the blocks in signalling mode
are sepreded over 6 bursts instead of 4. This also needs to be taken
into account.

Change-Id: I01c7b6cc908c647263ab88f6b6281c4732f88779
Related: OS#4799
This commit is contained in:
Philipp Maier 2020-10-23 21:48:27 +02:00
parent 79294134dd
commit 07aa8927e1
2 changed files with 25 additions and 7 deletions

View File

@ -397,11 +397,16 @@ static unsigned int lchan_meas_num_expected(const struct gsm_lchan *lchan)
switch (pchan) {
case GSM_PCHAN_TCH_F:
/* 24 for TCH + 1 for SACCH */
/* 24 blocks for TCH + 1 for SACCH */
return 25;
case GSM_PCHAN_TCH_H:
/* 24 half-blocks for TCH + 1 for SACCH */
return 25;
if (lchan->tch_mode == GSM48_CMODE_SIGN) {
/* 12 blocks for TCH + 1 for SACCH */
return 13;
} else {
/* 24 blocks for TCH + 1 for SACCH */
return 25;
}
case GSM_PCHAN_SDCCH8_SACCH8C:
case GSM_PCHAN_SDCCH8_SACCH8C_CBCH:
/* 2 for SDCCH + 1 for SACCH */
@ -428,11 +433,21 @@ static unsigned int lchan_meas_sub_num_expected(const struct gsm_lchan *lchan)
switch (pchan) {
case GSM_PCHAN_TCH_F:
/* 1 block SDCCH, 2 blocks TCH */
return 3;
if (lchan->tch_mode == GSM48_CMODE_SIGN) {
/* 1 block SACCH, 24 blocks TCH (see note 1) */
return 25;
} else {
/* 1 block SACCH, 2 blocks TCH */
return 3;
}
case GSM_PCHAN_TCH_H:
/* 1 block SDCCH, 4 half-blocks TCH */
return 5;
if (lchan->tch_mode == GSM48_CMODE_SIGN) {
/* 1 block SACCH, 12 blocks TCH (see ynote 1) */
return 13;
} else {
/* 1 block SACCH, 4 blocks TCH */
return 5;
}
case GSM_PCHAN_SDCCH8_SACCH8C:
case GSM_PCHAN_SDCCH8_SACCH8C_CBCH:
/* no DTX here, all blocks must be present! */
@ -444,6 +459,8 @@ static unsigned int lchan_meas_sub_num_expected(const struct gsm_lchan *lchan)
default:
return 0;
}
/* Note 1: In signalling mode all blocks count as SUB blocks. */
}
/* if we clip the TOA value to 12 bits, i.e. toa256=3200,

View File

@ -84,6 +84,7 @@ static void test_meas_compute(const struct meas_testcase *mtc)
lchan = &trx->ts[mtc->ts].lchan[0];
lchan->ts->pchan = mtc->pchan;
lchan->tch_mode = GSM48_CMODE_SPEECH_V1;
reset_lchan_meas(lchan);
/* feed uplink measurements into the code */