summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/gsm/gsm_utils.h3
-rw-r--r--src/gsm/gsm_utils.c11
-rw-r--r--src/gsm/libosmogsm.map1
3 files changed, 15 insertions, 0 deletions
diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h
index a879d33c..bfcef08b 100644
--- a/include/osmocom/gsm/gsm_utils.h
+++ b/include/osmocom/gsm/gsm_utils.h
@@ -165,6 +165,9 @@ uint16_t gsm_freq102arfcn(uint16_t freq10, int uplink);
/* Convert from frame number to GSM time */
void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn);
+/* Parse GSM Frame Number into printable string */
+char *gsm_fn_as_gsmtime_str(uint32_t fn);
+
/* Convert from GSM time to frame number */
uint32_t gsm_gsmtime2fn(struct gsm_time *time);
diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index 2c980d28..477f076d 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -750,6 +750,17 @@ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn)
time->tc = (time->fn / 51) % 8;
}
+/*! Parse GSM Frame Number into printable string
+ * \param[in] fn GSM Frame Number
+ * \returns pointer to printable string */
+char *gsm_fn_as_gsmtime_str(uint32_t fn)
+{
+ struct gsm_time time;
+
+ gsm_fn2gsmtime(&time, fn);
+ return osmo_dump_gsmtime(&time);
+}
+
/*! Encode decoded \ref gsm_time to Frame Number
* \param[in] time GSM Time in decoded structure
* \returns GSM Frame Number */
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index ad7e0131..714cb25f 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -272,6 +272,7 @@ gsm_freq102arfcn;
gsm_band_name;
gsm_band_parse;
gsm_fn2gsmtime;
+gsm_fn_as_gsmtime_str;
gsm_get_octet_len;
gsm_gsmtime2fn;
osmo_dump_gsmtime;