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/.
Pau Espin Pedrol gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/3099 gsm_utils: Add osmo_dump_gsmtime Used by osmo-bts. Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/99/3099/1 diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 998f681..a879d33 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -168,6 +168,9 @@ /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); +/* Returns static buffer with string representation of a GSM Time */ +char *osmo_dump_gsmtime(const struct gsm_time *tm); + /* GSM TS 03.03 Chapter 2.6 */ enum gprs_tlli_type { TLLI_LOCAL, diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 61d3f83..f565513 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -758,6 +758,16 @@ return (51 * ((time->t3 - time->t2 + 26) % 26) + time->t3 + (26 * 51 * time->t1)); } +char *osmo_dump_gsmtime(const struct gsm_time *tm) +{ + static char buf[64]; + + snprintf(buf, sizeof(buf), "%06u/%02u/%02u/%02u/%02u", + tm->fn, tm->t1, tm->t2, tm->t3, tm->fn%52); + buf[sizeof(buf)-1] = '\0'; + return buf; +} + /*! append range1024 encoded data to bit vector * \param[out] bv Caller-provided output bit-vector * \param[in] r Input Range1024 sructure */ -- To view, visit https://gerrit.osmocom.org/3099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5452e2c20f53006c0f6d197fb055728947125d8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>