aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/Stream.cpp
AgeCommit message (Collapse)Author
2022-03-07rename arduino core dir to xinputHEADmasterHampusM
2019-09-04remove unnecessary if branchAkihiro YAMAZAKI
checking `length` in below while statement
2017-07-07Update comments to reflect Stream functions changed from private to protectedper1234
These functions were changed from private to protected in https://github.com/arduino/Arduino/commit/99f2a2755349784835130147e46cb61659b85893 but the comments were not updated at that time. In conjunction with equivalent pull requests to Arduino SAM Boards and Arduino SAMD Boards, solves https://github.com/arduino/Arduino/issues/6146.
2015-11-23Cleanup some Stream compiler warnings from #3337Sandeep Mistry
2015-11-23Make protected Stream::parseInt/Float overloads public.Chris--A
Stream::parseInt & Stream::parseFloat previously had protected overloads which allowed skipping a custom character. This commit brings this feature to the public interface. To keep the public API simpler, the single paramter overload remains protected. However its functionality is available in the public interface using the two parameter overload.
2015-11-23This adds control of Stream::parseInt/float lookahead.Chris--A
Its default is SKIP_ALL which reflects previous versions. However SKIP_NONE, and SKIP_WHITESPACE can refine this behaviour. A parameter used in the protected overloads of parseInt/Float has been changed from `skipChar` to `ignore`.
2015-11-23This is a bug fix which prevents parseFloat from proceeding pastChris--A
multiple decimals '.' in the stream. Only one can be accepted for valid decimal numbers.
2015-11-23This commit improves the parsing capability by allowing decimals onlyChris--A
prefixed by an '.' character. Previously the preceeding zero must be present: '0.'
2015-04-21Fixed indentation in Stream.cpp, no code changeCristian Maglie
2015-04-21Fixed wrong bracket placement (see #3011)Cristian Maglie
2015-04-21Fixed: warning: comparison between signed and unsigned integer expressionsKristian Sloth Lauszus
2015-04-21Fixed: warning: suggest explicit braces to avoid ambiguous 'else'Kristian Sloth Lauszus
2015-03-24Fix findUntil in Stream libraryJim Leonard (Xuth)
PR #2696 without timeout-related changes
2014-07-17Cast empty string to char* to fix compiler warningMatt Robinson
Stream::find(char *target) passes an empty terminator string to Stream::findUntil(char *target, char *terminator) which caused a compiler warning with the updated toolchain, so cast it to a char*.
2014-06-13Merge branch 'master' into HEADCristian Maglie
2014-05-30Fix of a bugAmulya Kumar Sahoo
Stream::find(char *target) passes NULL as “terminator” to Stream::findUntil(char *target, char *terminator), which immediately dereferences it by passing it on to strlen(): bool Stream::find(char *target) { return findUntil(target, NULL); } // as find but search ends if the terminator string is found bool Stream::findUntil(char *target, char *terminator) { return findUntil(target, strlen(target), terminator, strlen(terminator)); }
2014-02-19Don't store peeked characters in a char variableMatthijs Kooijman
peekNextDigit() returns an int, so it can return -1 in addition to all 256 possible bytes. By putting the result in a signe char, all bytes over 128 will be interpreted as "no bytes available". Furthermore, it seems that on SAM "char" is unsigned by default, causing the "if (c < 0)" line a bit further down to always be false. Using an int is more appropriate. A different fix for this issue was suggested in #1399. This fix helps towards #1728.
2012-05-16Adding readString() and readStringUntil() to Stream (Adrian McEwen).David A. Mellis
This isn't necessarily a particularly efficient implementation (it allocates memory one character at a time and so may lead to fragmentation) but it seems to work. http://code.google.com/p/arduino/issues/detail?id=454
2012-01-02Fixing findUntil() problem with repeated initial characters. (Jeffery.zksun)David A. Mellis
http://code.google.com/p/arduino/issues/detail?id=768
2011-11-19readBytes() and readBytesUntil() handle zero bytes and return # of bytes read.David A. Mellis
http://code.google.com/p/arduino/issues/detail?id=586
2011-10-02Fixing warnings in Stream (Paul Stoffregen)David A. Mellis
http://code.google.com/p/arduino/issues/detail?id=208
2011-09-09Don't consume trailing char in parseInt() and parseFloat (Paul Stoffregen).David A. Mellis
http://code.google.com/p/arduino/issues/detail?id=624
2011-08-18Stream.readBytesUntil() now writes null terminator within length.David A. Mellis
2011-08-17A few API changes to new Stream parsing functions.David A. Mellis
Renamed readChars() -> readBytes(), readCharsUntil() -> readBytesUntil(). Changed timeouts to milliseconds from seconds; default from 5 to 1 seconds. Removed readCharsBetween().
2011-08-17Integrating Stream searching & parsing (Michael Margolis)David A. Mellis
This from Michael's TextFinder library, incorporated into the Stream class: find(), findUntil(), parseInt(), parseFloat(), readChars(), readCharsUntil(), readCharsBetween(), setTimeout().