We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsSoftware Bugs › Patch for Serial.readBytesUntil data-dropping bug
Page Index Toggle Pages: 1
Patch for Serial.readBytesUntil data-dropping bug (Read 928 times)
Patch for Serial.readBytesUntil data-dropping bug
May 22nd, 2005, 11:28pm
 
The readBytesUntil function currently drops any data in the buffer after the "interesting" character.  So if, for example, two lines are read into the buffer before readStringUntil('\n') gets called, the first line is returned and the second vanishes.

Here's a patch (is this the right place for this sort of thing, btw?):

Index: serial/Serial.java
===================================================================
RCS file: /cvsroot/processing/processing/serial/Serial.java,v
retrieving revision 1.2
diff -r1.2 Serial.java
408,409c408,412
<       bufferIndex = 0;  // rewind
<       bufferLast = 0;
---
>       bufferIndex += length;
>       if (bufferIndex == bufferLast) {
>         bufferIndex = 0;  // rewind
>         bufferLast = 0;
>       }

Re: Patch for Serial.readBytesUntil data-dropping
Reply #1 - May 23rd, 2005, 11:53pm
 
this is a fine place for patches.. actually the serial stuff needs a good bit of care.. that it's not properly synchronizing things incoming and outgoing and how it handles serial events. the "until" stuff was added late and kinda breaks how the other stuff works so i need to put some time in on fixing it up.
Re: Patch for Serial.readBytesUntil data-dropping
Reply #2 - Jul 28th, 2005, 4:40am
 
now tracking this bug at:
http://dev.processing.org/bugs/show_bug.cgi?id=96
closing thread.
Page Index Toggle Pages: 1