<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    eisencah eisenach wrote:
    <blockquote
      cite="mid:1339587844.29750.YahooMailNeo@web112118.mail.gq1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:times
        new roman, new york, times, serif;font-size:12pt">
        <div><span><br>
          </span></div>
        Hi.<br>
        Is there any reason why in the sim_handler()  function,  in <br>
        <br>
            case SIM_STATE_TX_DATA:<br>
                if (!txDoneFlag)<br>
                    break; /* wait until data is transmitted */<br>
                /* Disable all interrupt driven functions */<br>
                writew(0xFF, REG_SIM_MASKIT);<br>
                /* Ignore waiting char for RUN GSM ALGORITHM */<br>
                /* TODO: implement proper handling of the "Procedure
        Bytes"<br>
                   than this is no longer needed */<br>
                if(sim_data[1] == 0x88)<br>
                    sim_ignore_waiting_char = 1;<br>
                sim_state = SIM_STATE_RX_STATUS;<br>
                calypso_sim_receive(response + length + 1, 2);<br>
                break;<br>
        <br>
        we do "calypso_sim_receive(response + length + 1, 2);" instead
        of   "calypso_sim_receive(response + 1, 2);". <br>
        Seems an unnecessary overhead sending back some junk chars
        there. Or I'm missing something?<br>
        Cheers,<br>
        Mihai.<br>
        <br>
      </div>
    </blockquote>
    hi mihai,<br>
    <br>
    iirc, there is a reason for that. the response is allocated with
    length + 1 + 2. at the end of the response string, there are the
    status bytes, so "length + 1" is added, so the status will appear at
    the end of the response message. the upper layer always reads the
    status from the last two bytes. if you would remove the length, the
    status would be at the wrong place.<br>
    <br>
    regards,<br>
    <br>
    andreas<br>
    <br>
  </body>
</html>