Hoernchen has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27342 )


Change subject: simtrace emulation: check that port is connected to prevent 
errors due to delayed msg
......................................................................

simtrace emulation: check that port is connected to prevent errors due to 
delayed msg

Change-Id: I5d5dda0cf1443223b2615f1059cfdcf698f1acae
---
M library/SIMTRACE_Emulation.ttcn
1 file changed, 6 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/42/27342/1

diff --git a/library/SIMTRACE_Emulation.ttcn b/library/SIMTRACE_Emulation.ttcn
index c907608..74bc380 100644
--- a/library/SIMTRACE_Emulation.ttcn
+++ b/library/SIMTRACE_Emulation.ttcn
@@ -118,14 +118,18 @@
                /* Submit another IN transfer */
                f_usb_submit_xfer(g_ep_in);
                stpdu_in := dec_SIMTRACE_PDU(tc.data);
-               INOUT.send(stpdu_in);
+               if (INOUT.checkstate("Connected")) {
+                       INOUT.send(stpdu_in);
+               }
                }
        [] USB.receive(tr_UsbXfer_compl(g_ep_irq, USB_TRANSFER_TYPE_INTERRUPT,
                                        USB_TRANSFER_COMPLETED, g_dev_hdl, 
?))-> value tc {
                /* Submit another IRQ transfer */
                f_usb_submit_xfer(g_ep_irq, ttype := 
USB_TRANSFER_TYPE_INTERRUPT);
                stpdu_in := dec_SIMTRACE_PDU(tc.data);
-               IRQ.send(stpdu_in);
+               if (IRQ.checkstate("Connected")) {
+                       IRQ.send(stpdu_in);
+               }
                }
        [] USB.receive(tr_UsbXfer_compl(g_ep_irq, USB_TRANSFER_TYPE_INTERRUPT,
                                        USB_TRANSFER_TIMED_OUT, g_dev_hdl, ?)) 
-> value tc {

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5d5dda0cf1443223b2615f1059cfdcf698f1acae
Gerrit-Change-Number: 27342
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <[email protected]>
Gerrit-MessageType: newchange

Reply via email to