diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2020-05-02 16:49:17 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2020-05-03 22:57:08 +0700 |
commit | 5d2cf443cacf7ca223a51532d367efe30e65589c (patch) | |
tree | 203cbf3f84ec918c5566426ec075e571f6cb5cdf /bts/BTS_Tests.ttcn | |
parent | 2b98bda8dc6da01be0e6d01175b4584db0e75c3c (diff) |
BTS: refactor f_si3_has_gprs_indicator(): use SI3RestOctets
Change-Id: I2dc970d3d34a7d70c6845558544259e387f1d6fc
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
Diffstat (limited to 'bts/BTS_Tests.ttcn')
-rw-r--r-- | bts/BTS_Tests.ttcn | 63 |
1 files changed, 4 insertions, 59 deletions
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 794d604c..7191a7d8 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -29,6 +29,7 @@ import from GSM_Types all; import from GSM_RR_Types all; import from Osmocom_Types all; import from GSM_Types all; +import from GSM_RestOctets all; import from GSM_SystemInformation all; import from L1CTL_PortType all; import from L1CTL_Types all; @@ -4904,65 +4905,9 @@ private function f_get_si3(L1CTL_PT pt) runs on test_CT return SystemInformation return si.payload.si3; } -/* CSN.1 L/H logic: is the bit at the current position using "inverted logic" (true) or not? */ -private function f_bitpos_is_inv(integer idx) return boolean { - select (idx mod 8) { - case ((2, 4, 6, 7)) { return true; } /* 1-bits of 0x2B */ - case else { return false; } /* 0-bits of 0x2B */ - } -} -/* determine if the bit at position 'idx' in 'str' is a CSN.1 'H' (true) or 'L' (false) */ -private function f_bit_is_high(bitstring str, integer idx) return boolean { - var boolean invert := f_bitpos_is_inv(idx); - if (invert) { - if (str[idx] == '1'B) { - return false; - } else { - return true; - } - } else { - if (str[idx] == '1'B) { - return true; - } else { - return false; - } - } -} -/* As the TITAN RAW codec cannot expres the CSN.1 L/H concept yet, we have to do this - manually. Let's hope https://www.eclipse.org/forums/index.php/t/1099087/ takes off and - we can replace this piece of code soon ... */ -private function f_si3_has_gprs_indicator(OCT4 si3_restoctets) return boolean { - var bitstring bits := oct2bit(si3_restoctets); - var integer idx := 0; - - if (f_bit_is_high(bits, idx)) { - /* skip Optional selection parameters */ - idx := idx + 16; - } else { - idx := idx + 1; - } - - if (f_bit_is_high(bits, idx)) { - /* skip Optional power offset */ - idx := idx + 3; - } else { - idx := idx + 1; - } - - /* skip SI2ter Indicator */ - idx := idx + 1; - - /* skip Early CM Sending Control */ - idx := idx + 1; - - /* skip Scheduling if and where */ - if (f_bit_is_high(bits, idx)) { - idx := idx + 4; - } else { - idx := idx + 1; - } - - return f_bit_is_high(bits, idx); +private function f_si3_has_gprs_indicator(RestOctets ro) return boolean { + var SI3RestOctets rest := dec_SI3RestOctets(ro); + return rest.gprs_ind.presence == '1'B; } testcase TC_pcu_socket_noconnect_nosi3gprs() runs on test_CT { |