title: Trouble with the Buffer using bluetooth of android
body: <p>I'm using the bluetooth of an android phone to send some data (strings) to an arduino with bluetooth device.</p>
  
  <p>All works like charm... but I can only send 325 strings!!! (each string only contains 2 positive int numbers).</p>
  
  <p>After this, at the logcat of eclipse, appears me this message: "rfc_setup_rx_bufout of buffer: rfc_setup_rx_bufout of buffer: Out of Buffers" each time that the android tries to send a new data.</p>
  
  <p>I can't close the bluetoothsocket and reopen it (or connect) during the application cause I need to send data very fast for my purpose(about 100-200 ms one after another) and there's no time for that. How can I "clear" the buffer? Is it really the problem with the buffer??</p>
  
  <p>Part of the code I'm ussing this:</p>
  
  <pre><code>    &lt;code&gt;
  
  private BluetoothSocket btSocket = null; 
  try { 
              btSocket = device.createRfcommSocketToServiceRecord(MY_UUID);
  
         } catch (IOException e) { 
  
         } 
             try { 
                  outStream = btSocket.getOutputStream(); 
  
             } catch (IOException e) { 
                  Log.e(TAG, "ON RESUME: Output stream creation failed.", e); 
             } 
  
  byte[] msgBuffer = message.getBytes(); 
             try { 
                  outStream.write(msgBuffer); 
  
             } catch (IOException e) { 
                  Log.e(TAG, "ON RESUME: Exception during write.", e); 
             } 
  
  
  &lt;/code&gt;
  </code></pre>
  
  <p>The "message" in message.getBytes(); is actually the string that I'm sending.</p>
  
  <p>Another thing:  I'm ussing an array (byte[] msgBuffer). Is there anyway I can make a "loop" to get to the [0] or [1] index after sending the data so this string will never be full cause I would only use 2 values.</p>
  
  <p>Or the problem is with an internal buffer of my phone (samsung GT-I5500) and no with the code?</p>
  
  <p>A will really apreciate any help cause I'm stuck in this.</p>