remsim_client: Use osmocom logging instead of printf

Change-Id: I7e695335b4c4652a534cefa073dcea9f424d6744
changes/97/13497/1
Harald Welte 4 years ago
parent 94ba99b5d0
commit 8d8d4f162b
  1. 10
      src/remsim_client.c
  2. 10
      src/simtrace2-remsim_client.c

@ -46,7 +46,7 @@ static int bankd_handle_msg(struct bankd_client *bc, struct msgb *msg)
{
RsproPDU_t *pdu = rspro_dec_msg(msg);
if (!pdu) {
fprintf(stderr, "Error decoding PDU\n");
LOGPFSML(bc->bankd_fi, LOGL_ERROR, "Error decoding PDU\n");
return -1;
}
@ -59,7 +59,8 @@ static int bankd_handle_msg(struct bankd_client *bc, struct msgb *msg)
osmo_fsm_inst_dispatch(bc->bankd_fi, BDC_E_CLIENT_CONN_RES, pdu);
break;
default:
fprintf(stderr, "Unknown/Unsuppoerted RSPRO PDU: %s\n", msgb_hexdump(msg));
LOGPFSML(bc->bankd_fi, LOGL_ERROR, "Unknown/Unsuppoerted RSPRO PDU %s: %s\n",
rspro_msgt_name(pdu), msgb_hexdump(msg));
return -1;
}
@ -96,7 +97,7 @@ int bankd_read_cb(struct ipa_client_conn *conn, struct msgb *msg)
msg->l2h = &he->data[0];
switch (he->proto) {
case IPAC_PROTO_EXT_RSPRO:
printf("Received RSPRO %s\n", msgb_hexdump(msg));
LOGPFSML(bc->bankd_fi, LOGL_DEBUG, "Received RSPRO %s\n", msgb_hexdump(msg));
rc = bankd_handle_msg(bc, msg);
break;
default:
@ -152,7 +153,8 @@ static int srvc_handle_rx(struct rspro_server_conn *srvc, const RsproPDU_t *pdu)
server_conn_send_rspro(srvc, resp);
break;
default:
fprintf(stderr, "Unknown/Unsupported RSPRO PDU type: %u\n", pdu->msg.present);
LOGPFSML(srvc->fi, LOGL_ERROR, "Unknown/Unsupported RSPRO PDU type: %s\n",
rspro_msgt_name(pdu));
return -1;
}

@ -559,7 +559,7 @@ static int bankd_handle_msg(struct bankd_client *bc, struct msgb *msg)
{
RsproPDU_t *pdu = rspro_dec_msg(msg);
if (!pdu) {
fprintf(stderr, "Error decoding PDU\n");
LOGPFSML(bc->bankd_fi, LOGL_ERROR, "Error decoding PDU\n");
return -1;
}
@ -573,7 +573,8 @@ static int bankd_handle_msg(struct bankd_client *bc, struct msgb *msg)
bankd_handle_tpduCardToModem(bc, pdu);
break;
default:
fprintf(stderr, "Unknown/Unsuppoerted RSPRO PDU: %s\n", msgb_hexdump(msg));
LOGPFSML(bc->bankd_fi, LOGL_ERROR, "Unknown/Unsuppoerted RSPRO PDU %s: %s\n",
rspro_msgt_name(pdu), msgb_hexdump(msg));
return -1;
}
@ -599,7 +600,7 @@ int bankd_read_cb(struct ipa_client_conn *conn, struct msgb *msg)
if (he->proto != IPAC_PROTO_EXT_RSPRO)
goto invalid;
printf("Received RSPRO %s\n", msgb_hexdump(msg));
LOGPFSML(bc->bankd_fi, LOGL_DEBUG, "Received RSPRO %s\n", msgb_hexdump(msg));
rc = bankd_handle_msg(bc, msg);
@ -643,7 +644,8 @@ static int srvc_handle_rx(struct rspro_server_conn *srvc, const RsproPDU_t *pdu)
server_conn_send_rspro(srvc, resp);
break;
default:
fprintf(stderr, "Unknown/Unsupported RSPRO PDU type: %u\n", pdu->msg.present);
LOGPFSML(srvc->fi, LOGL_ERROR, "Unknown/Unsupported RSPRO PDU type: %s\n",
rspro_msgt_name(pdu));
return -1;
}

Loading…
Cancel
Save