laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-remsim/+/28565 )


Change subject: client: Log TPDU/ATR/PTS/slotStatus at INFO or NOTICE level
......................................................................

client: Log TPDU/ATR/PTS/slotStatus at INFO or NOTICE level

Closes: OS#5615
Change-Id: I9b54a53ef2809c9bfd110636a9ccb0c0d8c90cda
---
M src/client/main_fsm.c
1 file changed, 16 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/65/28565/1

diff --git a/src/client/main_fsm.c b/src/client/main_fsm.c
index be3238f..fb73929 100644
--- a/src/client/main_fsm.c
+++ b/src/client/main_fsm.c
@@ -230,6 +230,7 @@
        RsproPDU_t *pdu_rx = NULL;
        RsproPDU_t *resp;
        BankSlot_t bslot;
+       SlotPhysStatus_t *phys_status;
 
        switch (event) {
        case MF_E_BANKD_LOST:
@@ -264,6 +265,9 @@
                pdu_rx = data;
                OSMO_ASSERT(pdu_rx);
                OSMO_ASSERT(pdu_rx->msg.present == 
RsproPDUchoice_PR_tpduCardToModem);
+               LOGPFSML(fi, LOGL_NOTICE, "Rx tpduCardToModem(%s)\n",
+                        
osmo_hexdump_nospc(pdu_rx->msg.choice.tpduCardToModem.data.buf,
+                                           
pdu_rx->msg.choice.tpduCardToModem.data.size));
                /* forward to modem/cardem (via API) */
                frontend_handle_card2modem(bc, 
pdu_rx->msg.choice.tpduCardToModem.data.buf,
                                           
pdu_rx->msg.choice.tpduCardToModem.data.size);
@@ -273,6 +277,9 @@
                pdu_rx = data;
                OSMO_ASSERT(pdu_rx);
                OSMO_ASSERT(pdu_rx->msg.present == RsproPDUchoice_PR_setAtrReq);
+               LOGPFSML(fi, LOGL_NOTICE, "Rx setAtrReq(%s)\n",
+                        
osmo_hexdump_nospc(pdu_rx->msg.choice.setAtrReq.atr.buf,
+                                           
pdu_rx->msg.choice.setAtrReq.atr.size));
                /* forward to modem/cardem (via API) */
                frontend_handle_set_atr(bc, 
pdu_rx->msg.choice.setAtrReq.atr.buf,
                                        pdu_rx->msg.choice.setAtrReq.atr.size);
@@ -284,12 +291,19 @@
                pdu_rx = data;
                OSMO_ASSERT(pdu_rx);
                OSMO_ASSERT(pdu_rx->msg.present == 
RsproPDUchoice_PR_bankSlotStatusInd);
+               phys_status = 
&pdu_rx->msg.choice.bankSlotStatusInd.slotPhysStatus;
+               LOGPFSML(fi, LOGL_NOTICE, "Rx bankSlotStatusInd(reset_act=%d, 
vcc_act=%d, clk_act=%d, "
+                        "card_pres=%d)\n", phys_status->resetActive, 
phys_status->vccPresent,
+                        phys_status->clkActive, phys_status->cardPresent);
                /* forward to modem/cardem (via API) */
                frontend_handle_slot_status(bc, 
&pdu_rx->msg.choice.bankSlotStatusInd.slotPhysStatus);
                break;
        case MF_E_MDM_STATUS_IND:
                pstatus = data;
                OSMO_ASSERT(pstatus);
+               LOGPFSML(fi, LOGL_NOTICE, "Tx clientSlotStatusInd(reset_act=%d, 
vcc_act=%d, clk_act=%d, "
+                        "card_pres=%d)\n", pstatus->flags.reset_active, 
pstatus->flags.vcc_present,
+                        pstatus->flags.clk_active, 
pstatus->flags.card_present);
                /* forward to bankd */
                bank_slot2rspro(&bslot, &bc->bankd_slot);
                resp = rspro_gen_ClientSlotStatusInd(bc->srv_conn.clslot, 
&bslot,
@@ -305,11 +319,13 @@
        case MF_E_MDM_PTS_IND:
                pts = data;
                OSMO_ASSERT(pts);
+               LOGPFSML(fi, LOGL_NOTICE, "PTS Indication (%s)\n", 
osmo_hexdump_nospc(pts->buf, pts->len));
                /* forward to bankd? */
                break;
        case MF_E_MDM_TPDU:
                tpdu = data;
                OSMO_ASSERT(tpdu);
+               LOGPFSML(fi, LOGL_INFO, "Tx tpduModemToCard (%s)\n", 
osmo_hexdump_nospc(tpdu->buf, tpdu->len));
                /* forward to bankd */
                bank_slot2rspro(&bslot, &bc->bankd_slot);
                resp = rspro_gen_TpduModem2Card(bc->srv_conn.clslot, &bslot, 
tpdu->buf, tpdu->len);

--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/28565
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I9b54a53ef2809c9bfd110636a9ccb0c0d8c90cda
Gerrit-Change-Number: 28565
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-MessageType: newchange

Reply via email to