title: Mbed ATCmdParser::recv using scanf type parameters yielding incorrect string results
body: <p>Using the mbed microcontroller platform to query a GSM module using AT Commands.<br />
  The following code does not work, it results in a failed request from timeout :</p>
  
  <pre><code>UARTSerial bus(PB_10, PB_11, 115200);
  bus.set_flow_control(Serial::RTSCTS, PB_14, PB_13);
  ATCmdParser parser(&amp;bus, AT_DELIMINATOR);
  
  char buffer[10];
  parser.send("AT+CPIN?");
  if (parser.recv("+CPIN: %2s", buffer))
  {
      log-&gt;info("[AT+CPIN?] Returned result %s", buffer);
  } else {
      log-&gt;info("[AT+CPIN?] Request failed");
  }
  </code></pre>
  
  <h2>The problem</h2>
  
  <p>The problem is the %2s parameter in the call to <code>parser.recv("+CPIN: %2s", buffer)</code> :</p>
  
  <ol>
  <li><p>If I remove the %2s the call succeeds but obviously I am not reading in any parameters.</p>
  
  <p><code>parser.recv("+CPIN: ")</code></p></li>
  <li><p>Or, I can change the %2s to %s but only the first character is read.</p>
  
  <p><code>parser.recv("+CPIN: %s", buffer)</code> yields buffer = <code>S</code> really the GSM modules is sending <code>SIM PIN</code></p></li>
  <li><p>I have also tried using %c instead of %s for scenario 2 but am getting the same results.</p></li>
  <li><p>Scenarios 2 and 3 fail also when using scanf() instead of recv() </p>
  
  <p><code>parser.scanf("+CPIN: %s\r", buffer)</code></p></li>
  </ol>
  
  <h2>Question</h2>
  
  <p>How can I read the whole string before the line deliminator ?<br />
  Bonus points if you can tell me how to read a string with a space in it !</p>
  
  <h2>Expected results</h2>
  
  <p>One of the following values should be copied into <code>buffer</code> :</p>
  
  <ul>
  <li>READY</li>
  <li>SIM PIN</li>
  <li>SIM PUK</li>
  <li>PH-SIM PIN</li>
  <li>PH-FSIM PIN</li>
  <li>PH-FSIM PUK</li>
  <li>SIM PIN2</li>
  <li>SIM PUK2</li>
  <li>PH-NET PIN</li>
  <li>PH-NET PUK</li>
  <li>PH-NETSUB PIN</li>
  <li>PH-NETSUB PUK</li>
  <li>PH-SP PIN</li>
  <li>PH-SP PUK</li>
  <li>PH-CORP PIN</li>
  <li>PH-CORP PUK</li>
  <li>PH-MCL PIN</li>
  </ul>