<p>Kévin Redon has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/9965">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix 'ISO_S_IN_ATR not handled' gcc warning<br><br>when building the cardem application GCC would output the following warning:<br>libcommon/source/card_emu.c: In function 'card_emu_process_rx_byte':<br>libcommon/source/card_emu.c:764:2: warning: enumeration value 'ISO_S_IN_ATR' not handled in switch [-Wswitch]<br>  switch (ch->state) {<br>  ^~~~~~<br><br>in card emulation the reader should not send data while the card is<br>sending its ATR.<br>this is true for other states already handled (RESET, ...). in<br>these cases an error message is output.<br>this behaviour is now the default case as data from the reader is<br>only expected in 3 cases: ISO_S_WAIT_TPDU, ISO_S_IN_TPDU, and<br>ISO_S_IN_PTS.<br><br>Change-Id: Ifbc8dbe1c9f176343304f211c7e6068fb977961e<br>---<br>M firmware/libcommon/source/card_emu.c<br>1 file changed, 4 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/65/9965/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c</span><br><span>index 9291064..94a601a 100644</span><br><span>--- a/firmware/libcommon/source/card_emu.c</span><br><span>+++ b/firmware/libcommon/source/card_emu.c</span><br><span>@@ -762,14 +762,6 @@</span><br><span>  ch->stats.rx_bytes++;</span><br><span> </span><br><span>         switch (ch->state) {</span><br><span style="color: hsl(0, 100%, 40%);">- case ISO_S_WAIT_POWER:</span><br><span style="color: hsl(0, 100%, 40%);">-  case ISO_S_WAIT_CLK:</span><br><span style="color: hsl(0, 100%, 40%);">-    case ISO_S_WAIT_RST:</span><br><span style="color: hsl(0, 100%, 40%);">-    case ISO_S_WAIT_ATR:</span><br><span style="color: hsl(0, 100%, 40%);">-            TRACE_ERROR("%u: Received UART char in invalid 7816 state "</span><br><span style="color: hsl(0, 100%, 40%);">-                       "%u\r\n", ch->num, ch->state);</span><br><span style="color: hsl(0, 100%, 40%);">-              /* we shouldn't receive any data from the reader yet! */</span><br><span style="color: hsl(0, 100%, 40%);">-            break;</span><br><span>       case ISO_S_WAIT_TPDU:</span><br><span>                if (byte == 0xff) {</span><br><span>                  new_state = process_byte_pts(ch, byte);</span><br><span>@@ -783,6 +775,10 @@</span><br><span>       case ISO_S_IN_PTS:</span><br><span>           new_state = process_byte_pts(ch, byte);</span><br><span>              goto out_silent;</span><br><span style="color: hsl(120, 100%, 40%);">+      default:</span><br><span style="color: hsl(120, 100%, 40%);">+              TRACE_ERROR("%u: Received UART char in invalid 7816 state "</span><br><span style="color: hsl(120, 100%, 40%);">+                     "%u\r\n", ch->num, ch->state);</span><br><span style="color: hsl(120, 100%, 40%);">+            break;</span><br><span>       }</span><br><span> </span><br><span> out_silent:</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9965">change 9965</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/9965"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: simtrace2 </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ifbc8dbe1c9f176343304f211c7e6068fb977961e </div>
<div style="display:none"> Gerrit-Change-Number: 9965 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kévin Redon <kredon@sysmocom.de> </div>