Change in osmo-ttcn3-hacks[master]: library/IPA_Types: WIP codec for IPA UnitID (site/bts/trx)

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Mon Dec 6 17:06:29 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26458 )


Change subject: library/IPA_Types: WIP codec for IPA UnitID (site/bts/trx)
......................................................................

library/IPA_Types: WIP codec for IPA UnitID (site/bts/trx)

Change-Id: I68eb0d9e28bbf5d2d8ffe916aae5a66a0fdb9bd0
---
M library/IPA_Types.ttcn
1 file changed, 40 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/26458/1

diff --git a/library/IPA_Types.ttcn b/library/IPA_Types.ttcn
index 95623ef..6bb7d07 100644
--- a/library/IPA_Types.ttcn
+++ b/library/IPA_Types.ttcn
@@ -132,6 +132,46 @@
        extension "decode(RAW)"
      }
 
+/* Example: 1234/0/1 (site 1234, BTS#0, TRX#0) */
+type record IpaUnitId {
+	integer		site_id,
+	integer		bts_id,
+	integer		trx_id
+} with {
+	encode "TEXT"
+	variant "SEPARATOR('/', '/')"
+};
+
+external function enc_IpaUnitId(in IpaUnitId unit_id) return charstring
+	with { extension "prototype(convert) encode(TEXT)" }
+external function dec_IpaUnitId(in charstring stream) return IpaUnitId
+	with { extension "prototype(convert) decode(TEXT)" }
+
+template (value) IpaUnitId ts_IpaUnitId(integer site_id := 1234,
+					integer bts_id := 0,
+					integer trx_id := 0) := {
+	site_id := site_id,
+	bts_id  := bts_id,
+	trx_id  := trx_id
+};
+template IpaUnitId tr_IpaUnitId(template (present) integer site_id := ?,
+				template (present) integer bts_id := ?,
+				template (present) integer trx_id := ?) := {
+	site_id := site_id,
+	bts_id  := bts_id,
+	trx_id  := trx_id
+};
+
+private type component Dummy_CT {  };
+
+testcase TC_selftest_IpaUnitId() runs on Dummy_CT {
+	var IpaUnitId unit_id := valueof(ts_IpaUnitId(1234, 0, 3));
+	var charstring unit_id_enc := enc_IpaUnitId(unit_id);
+
+	log("Enc: ", unit_id_enc);
+	log("Dec: ", dec_IpaUnitId(unit_id_enc & "\00"));
+}
+
 /* Finds an IE with the given tag in IPA IDENTITY RESPONSE.
  * Returns index of an IE if found, -1 otherwise. */
 function f_ipa_id_resp_find_ie(in IpaCcmIdResp resp, IpaCcmIdTag tag)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26458
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I68eb0d9e28bbf5d2d8ffe916aae5a66a0fdb9bd0
Gerrit-Change-Number: 26458
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211206/ea3b629d/attachment.htm>


More information about the gerrit-log mailing list