aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-07-05 17:38:28 +0200
committerlaforge <laforge@osmocom.org>2021-07-09 11:51:40 +0000
commit9d4865ecaea5dc17e3058777620d52e8efa4c8a5 (patch)
tree116172ceed098ba7c2f8f652862606640bc2a70e /include
parent7225fe49026bcc8e312ef6e5a2f40f4e385529cf (diff)
hodec2: [2/2] implement automatic choice between FULL and SUBSET measurements
Add TDMA_MEAS_SET_AUTO to indicate automatic choice between FULL and SUBSET measurements depending on DTX. So far use only in hodec2. TDMA_MEAS_SET_AUTO looks at each individual measurement report's DTX flag and for each report chooses FULL if DTX is not used, or SUB if DTX is used. The default setting for 'handover2 tdma-measurement' is still 'subset'. To use the automatic choice, users need configure handover2 tdma-measurement auto Change-Id: I67dce55ccf892c8679272ee5dfedc25620f0f725
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/bsc/handover_cfg.h19
-rw-r--r--include/osmocom/bsc/meas_rep.h6
2 files changed, 11 insertions, 14 deletions
diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h
index 6e003af94..551ce8df5 100644
--- a/include/osmocom/bsc/handover_cfg.h
+++ b/include/osmocom/bsc/handover_cfg.h
@@ -38,18 +38,6 @@ static inline int bool2i(bool arg)
return arg? 1 : 0;
}
-static inline bool a2tdma(const char *arg)
-{
- if (!strcmp(arg, "full"))
- return true;
- return false;
-}
-
-static inline const char *tdma2a(bool val)
-{
- return val? "full" : "subset";
-}
-
/* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members,
* function declarations or definitions... It is of the format
* HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL,
@@ -188,10 +176,13 @@ static inline const char *tdma2a(bool val)
"Disable in-call assignment\n" \
"Enable in-call assignment\n") \
\
- HO_CFG_ONE_MEMBER(bool, hodec2_full_tdma, subset, \
- "handover2 ", "tdma-measurement", "full|subset", a2tdma, "%s", tdma2a, \
+ HO_CFG_ONE_MEMBER(enum tdma_meas_set, hodec2_tdma_meas_set, subset, \
+ "handover2 ", "tdma-measurement", "auto|full|subset", \
+ tdma_meas_set_from_str, "%s", tdma_meas_set_name, \
HO_CFG_STR_HANDOVER2 \
"Define measurement set of TDMA frames\n" \
+ "Use full set when DTX is not in use, use subset when DTX is in use," \
+ " as indicated by each Measurement Report\n" \
"Full set of 102/104 TDMA frames\n" \
"Sub set of 4 TDMA frames (SACCH)\n") \
\
diff --git a/include/osmocom/bsc/meas_rep.h b/include/osmocom/bsc/meas_rep.h
index 5cfeb98fb..402a888b1 100644
--- a/include/osmocom/bsc/meas_rep.h
+++ b/include/osmocom/bsc/meas_rep.h
@@ -68,6 +68,12 @@ enum tdma_meas_set {
TDMA_MEAS_SET_AUTO,
};
+extern const struct value_string tdma_meas_set_names[];
+static inline const char *tdma_meas_set_name(enum tdma_meas_set val)
+{ return get_value_string(tdma_meas_set_names, val); }
+static inline enum tdma_meas_set tdma_meas_set_from_str(const char *name)
+{ return get_string_value(tdma_meas_set_names, name); }
+
/* obtain an average over the last 'num' fields in the meas reps */
int get_meas_rep_avg(const struct gsm_lchan *lchan,
enum tdma_meas_field field, enum tdma_meas_dir dir, enum tdma_meas_set set,