diff options
author | Pablo Neira Ayuso <pablo@gnumonks.org> | 2013-02-19 17:14:33 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@gnumonks.org> | 2013-02-19 17:14:33 +0100 |
commit | d32caea9ea848cb99698dfa6afd785022ac64973 (patch) | |
tree | 21950f317cb3d52bd4f4ff2ee524cd46592e6231 /examples/osmux-test-output.c | |
parent | aeeb4399a235e7dd25708adf59b3413133adbed2 (diff) |
osmux: add osmux_snprintf
Useful for debugging purposes. Modify also examples to use it.
Diffstat (limited to 'examples/osmux-test-output.c')
-rw-r--r-- | examples/osmux-test-output.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/osmux-test-output.c b/examples/osmux-test-output.c index 5fe2bba..ea07606 100644 --- a/examples/osmux-test-output.c +++ b/examples/osmux-test-output.c @@ -78,7 +78,7 @@ static void tx_cb(struct msgb *msg, void *data) char buf[4096]; osmo_rtp_snprintf(buf, sizeof(buf), msg); - printf("sending: %s\n", buf); + LOGP(DOSMUX_TEST, LOGL_DEBUG, "sending: %s\n", buf); osmo_dgram_send(conn, msg); amr_write(msg); @@ -102,10 +102,12 @@ int read_cb(struct osmo_dgram *conn) return -1; } - LOGP(DOSMUX_TEST, LOGL_DEBUG, "received OSMUX message (len=%d)\n", msg->len); + char buf[1024]; + osmux_snprintf(buf, sizeof(buf), msg); + LOGP(DOSMUX_TEST, LOGL_DEBUG, "received OSMUX message (len=%d) %s\n", + msg->len, buf); while((osmuxh = osmux_xfrm_output_pull(msg)) != NULL) { - printf("tx_sched\n"); osmux_xfrm_output(osmuxh, &h_output, &list); osmux_tx_sched(&list, tx_cb, NULL); } |