Move dump_gsmtime to libosmocore as osmo_dump_gsmtime

Internal l1sap dump_gsmtime has been moved to libosmocore as osmo_dump_gsmtime.
Remove use of internal function and replace with the libosmocore version.

Depends on libosmocore Ib5452e2c20f53006c0f6d197fb055728947125d8

Change-Id: Ia2f89965d970ed5bbb8c0d4f591a043e58c4bd66
This commit is contained in:
Pau Espin 2017-07-03 10:56:59 +02:00 committed by Harald Welte
parent ffdc05bc4e
commit f06ba300c4
1 changed files with 4 additions and 13 deletions

View File

@ -31,6 +31,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/l1sap.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/core/gsmtap.h>
#include <osmocom/core/gsmtap_util.h>
#include <osmocom/core/utils.h>
@ -52,16 +53,6 @@
#include <osmo-bts/power_control.h>
#include <osmo-bts/msg_utils.h>
static char *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;
}
struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx,
unsigned int chan_nr)
{
@ -627,13 +618,13 @@ static int lchan_pdtch_ph_rts_ind_loop(struct gsm_lchan *lchan,
loop_msg = msgb_dequeue(&lchan->dl_tch_queue);
if (!loop_msg) {
LOGP(DL1P, LOGL_NOTICE, "%s %s: no looped PDTCH message, sending empty\n",
gsm_lchan_name(lchan), dump_gsmtime(tm));
gsm_lchan_name(lchan), osmo_dump_gsmtime(tm));
/* empty downlink message */
p = msgb_put(msg, GSM_MACBLOCK_LEN);
memset(p, 0, GSM_MACBLOCK_LEN);
} else {
LOGP(DL1P, LOGL_NOTICE, "%s %s: looped PDTCH message of %u bytes\n",
gsm_lchan_name(lchan), dump_gsmtime(tm), msgb_l2len(loop_msg));
gsm_lchan_name(lchan), osmo_dump_gsmtime(tm), msgb_l2len(loop_msg));
/* copy over data from queued response message */
p = msgb_put(msg, msgb_l2len(loop_msg));
memcpy(p, msgb_l2(loop_msg), msgb_l2len(loop_msg));
@ -666,7 +657,7 @@ static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx,
gsm_fn2gsmtime(&g_time, fn);
DEBUGP(DL1P, "Rx PH-RTS.ind %s chan_nr=%d link_id=%d\n",
dump_gsmtime(&g_time), chan_nr, link_id);
osmo_dump_gsmtime(&g_time), chan_nr, link_id);
/* reuse PH-RTS.ind for PH-DATA.req */
if (!msg) {