I am a professional software engineer, but most of the repositories here are related to my hobby Arduino.
If you want to say thank you with a donation, you can or use PayPal
Arduino library with Stream helper classes. BufferedPrint stream for efficient networking. ChunkedPrint for HTTP chunked encoding. ChunkedStreamReader for HTTP chunked decoding. CStringBulder builds a c-string with Print class methods. StringReadStream to wrap string as Stream. And printf() function with formatting string from F macro.
License: GNU Affero General Public License v3.0
Hi I'm using a ESP32 and struggling with this error, any help would be appreciated
Hey I'm getting the following compile error when using it with PlatformIo.
Is this issue related to myself or sth. with the library?
.pio/libdeps/nano33iot/StreamLib/src/ChunkedPrint.cpp:55:20: error: invalid conversion from 'uint8_t* {aka unsigned char*}' to 'char*' [-fpermissive]
He is complaining about this line of code:
sprintf_P(buffer - l, (firstChunk ? PSTR("%x\r") : PSTR("\r\n%x\r")), pos);
When I comment out this line, everything compiles, like I would expect it.
What information do you need to help me out here?
Version 1.3.1 throws two warnings in Arduino IDE 1.8.19 for Arduino UNO:
In file included from C:\Daten\myrepository\Arduino\libraries\StreamLib\src/StreamLib.h:25:0,
from C:\Daten\myrepository\Arduino\HW_arduino\lcd_led_dht_server_client_ajax\lcd_led_dht_server_client_ajax.ino:50:
C:\Daten\myrepository\Arduino\libraries\StreamLib\src/ChunkedStreamReader.h: In member function 'virtual size_t ChunkedStreamReader::write(uint8_t)':
C:\Daten\myrepository\Arduino\libraries\StreamLib\src/ChunkedStreamReader.h:39:32: warning: unused parameter 'b' [-Wunused-parameter]
virtual size_t write(uint8_t b) {
^
In file included from C:\Daten\myrepository\Arduino\libraries\StreamLib\src/StreamLib.h:26:0,
from C:\Daten\myrepository\Arduino\HW_arduino\lcd_led_dht_server_client_ajax\lcd_led_dht_server_client_ajax.ino:50:
C:\Daten\myrepository\Arduino\libraries\StreamLib\src/StringReadStream.h: In member function 'virtual size_t StringReadStream::write(uint8_t)':
C:\Daten\myrepository\Arduino\libraries\StreamLib\src/StringReadStream.h:42:32: warning: unused parameter 'b' [-Wunused-parameter]
virtual size_t write(uint8_t b) {
both might be fixable with a simple
(void)b; // avoid warning unused parameter
Hello!
Many thanks for this awesome library!
I have to send a long string (>10 000 char) through my ENC28J60 with ESP8266. It is impossible due to calculation duration, the software WDT makes a reset.
I have already put a yield() inside :
size_t BufferedPrint::write(const uint8_t *buf, size_t length)
{
yield();
for (size_t...
Helped a lot but did not solved. Still crashing while writting.
How can it be improved?
Thanks in advance!
PS: my code is
const size_t BUFFER_SIZE = 128;
char html_buff[BUFFER_SIZE];
BufferedPrint message(client, html_buff, sizeof(html_buff));
message.print(F(HTML_STRING));
with HTML_STRING the 10Ko string.
some cores have the Arduino API older then 2017 and are missing Print::availbleForWrite function.
workaround:
int BufferedPrint::availableForWrite() {
// int a = target.availableForWrite();
// if (!a) // target doesn't report aFW or is really full
return size - pos; // then return space left in our buffer
// a = a - pos; // what will be left in target after our flush()
// return a < 0 ? 0 : a;
}
/home/duro/eclipse/arduinoPlugin/libraries/StreamLib/1.0.2/src/FormattedPrint.cpp:56:3: error: 'cookie_io_functions_t' was not declared in this scope
cookie_io_functions_t fncs;
^~~~~~~~~~~~~~~~~~~~~
/home/duro/eclipse/arduinoPlugin/libraries/StreamLib/1.0.2/src/FormattedPrint.cpp:57:3: error: 'fncs' was not declared in this scope
fncs.write = adapterWrite;
^~~~
/home/duro/eclipse/arduinoPlugin/libraries/StreamLib/1.0.2/src/FormattedPrint.cpp:57:3: note: suggested alternative: 'fls'
fncs.write = adapterWrite;
^~~~
fls
/home/duro/eclipse/arduinoPlugin/libraries/StreamLib/1.0.2/src/FormattedPrint.cpp:59:10: error: 'fopencookie' was not declared in this scope
return fopencookie(p, "w", fncs);
in stdio.h are added ifdefs which exclude 'cookie' section
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.