### Configure SAMD Core Include Directories Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/samd/CMakeLists.txt Sets the interface include directories for the 'SamdCore' library, pointing to the current source directory and the AVR subdirectory. ```cmake target_include_directories(SamdCore INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../avr ) ``` -------------------------------- ### Set STM32 Core Include Directories Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32/CMakeLists.txt Configures public include directories for the 'Stm32Core' library, including the current source directory and the '../avr' directory. ```cmake target_include_directories(Stm32Core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../avr ) ``` -------------------------------- ### Configure TeensyCore Include Directories Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/teensy/CMakeLists.txt Sets the public include directories for the TeensyCore library, including the current source directory and the '../avr' directory. ```cmake target_include_directories(TeensyCore PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../avr ) ``` -------------------------------- ### Set RP2040 Core Include Directories Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/rp2040/CMakeLists.txt Configures public include directories for the Rp2040Core library. ```cmake target_include_directories(Rp2040Core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../coreapi ) ``` -------------------------------- ### Add RP2040 Core Library Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/rp2040/CMakeLists.txt Adds the Rp2040Core library with its source files. ```cmake add_library(Rp2040Core EEPROM.cpp EEPROM.h ) ``` -------------------------------- ### Include Directories for ESP8266 Core Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/esp8266/CMakeLists.txt Specifies public include directories for the ESP8266 core library. ```cmake target_include_directories(Esp8266Core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../avr ) ``` -------------------------------- ### DxCore Include Directories Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/dxcore/CMakeLists.txt Specifies the include directories for the DxCore library. It includes the current source directory and a relative path to the 'avr' directory. ```cmake target_include_directories(DxCore INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../avr ) ``` -------------------------------- ### Include Directories for NRF52 Core Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/nrf52/CMakeLists.txt Specifies interface include directories for the NRF52Core library, including the current source directory and a relative path to 'avr'. ```cmake target_include_directories(Nrf52Core INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../avr ) ``` -------------------------------- ### Include Core Subdirectories Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/CMakeLists.txt Includes subdirectories for various microcontroller cores. This allows the project to be built for different platforms by adding their specific core implementations. ```cmake add_subdirectory(cores/avr) add_subdirectory(cores/dxcore) add_subdirectory(cores/esp32) add_subdirectory(cores/esp8266) add_subdirectory(cores/mbed) add_subdirectory(cores/nrf52) add_subdirectory(cores/rp2040) add_subdirectory(cores/samd) add_subdirectory(cores/stm32) add_subdirectory(cores/stm32f1) add_subdirectory(cores/stm32f4) add_subdirectory(cores/teensy) ``` -------------------------------- ### Compiler and Linker Options Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/CMakeLists.txt Configures compiler warnings and linker options for GNU and Clang compilers. Use this to enforce strict coding standards and create static executables. ```cmake if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") add_compile_options(-Wall -Wextra -Werror -Wundef) add_link_options(-static) endif() ``` -------------------------------- ### Add STM32 Core Library Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32/CMakeLists.txt Defines the 'Stm32Core' library using specified source and header files. ```cmake add_library(Stm32Core EEPROM.cpp EEPROM.h Stream.h ) ``` -------------------------------- ### Configure Serial for 7-bit Data Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Initialize a HardwareSerial port to use 7 data bits, no parity, and one stop bit. This is often used in conjunction with error-correction codes. ```c++ // Initialize serial port with 9600 bauds, 7 bits of data, no parity, and one stop bit Serial1.begin(9600, SERIAL_7N1); ``` -------------------------------- ### Log HTTP Request Writes Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Decorate a client to log all outgoing HTTP request data to the Serial port. Useful for debugging requests. ```c++ WriteLoggingStream loggingClient(client, Serial); loggingClient.println("GET / HTTP/1.1"); loggingClient.println("User-Agent: Arduino"); // ... ``` -------------------------------- ### Include Directories for STM32F1 Core Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32f1/CMakeLists.txt Specifies the include directories for the STM32F1 core library. It includes the current source directory and the '../avr' directory, likely for compatibility or shared headers. ```cmake target_include_directories(Stm32F1Core INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../avr ) ``` -------------------------------- ### Set MbedRp2040Core Include Directories Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/mbed/CMakeLists.txt Specifies the include directories for the MbedRp2040Core library. It includes the current source directory and a 'coreapi' subdirectory, making headers accessible during compilation. ```cmake target_include_directories(MbedRp2040Core INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../coreapi ) ``` -------------------------------- ### Compile Definitions for NRF52 Core Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/nrf52/CMakeLists.txt Adds the ARDUINO_ARCH_NRF52 compile definition for the NRF52Core library. ```cmake target_compile_definitions(Nrf52Core INTERFACE ARDUINO_ARCH_NRF52 ) ``` -------------------------------- ### Set STM32F4 Core Include Directories Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32f4/CMakeLists.txt Specifies the interface include directories for the STM32F4 core library. ```cmake target_include_directories(Stm32F4Core INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../stm32f1 ${CMAKE_CURRENT_SOURCE_DIR}/../avr ) ``` -------------------------------- ### Set RP2040 Core Compile Definitions Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/rp2040/CMakeLists.txt Defines preprocessor macros for the Rp2040Core library. ```cmake target_compile_definitions(Rp2040Core PUBLIC ARDUINO_ARCH_RP2040 ARDUINO_PICO_MAJOR=3 ) ``` -------------------------------- ### Add ESP8266 Core Library Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/esp8266/CMakeLists.txt Defines the ESP8266 core library with its source files. ```cmake add_library(Esp8266Core EEPROM.cpp EEPROM.h Stream.h ) ``` -------------------------------- ### DxCore Compile Definitions Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/dxcore/CMakeLists.txt Sets preprocessor definitions for the DxCore library. These definitions configure build-time options and version information for DxCore. ```cmake target_compile_definitions(DxCore PUBLIC ARDUINO_avrda ARDUINO_ARCH_MEGAAVR DXCORE="$" DXCORE_MAJOR=1UL DXCORE_MINOR=5UL DXCORE_PATCH=11UL DXCORE_RELEASED=1 ) ``` -------------------------------- ### Set Include Directories for doctest Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/doctest/CMakeLists.txt Configures the include directories for the doctest library. PUBLIC indicates that the include directories should be propagated to targets that link against doctest. ```cmake target_include_directories(doctest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) ``` -------------------------------- ### Set STM32F4 Core Compile Options Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32f4/CMakeLists.txt Applies specific compile options, like ignoring overloaded virtual warnings, to the STM32F4 core library. ```cmake target_compile_options(Stm32F4Core INTERFACE -Wno-overloaded-virtual ) ``` -------------------------------- ### Add DxCore Library Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/dxcore/CMakeLists.txt Defines the DxCore library using its source and header files. This is the primary step to include DxCore in your CMake project. ```cmake add_library(DxCore EEPROM.cpp EEPROM.h ) ``` -------------------------------- ### Set STM32F4 Core Compile Definitions Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32f4/CMakeLists.txt Adds the ARDUINO_ARCH_STM32F4 compile definition for the STM32F4 core library. ```cmake target_compile_definitions(Stm32F4Core INTERFACE ARDUINO_ARCH_STM32F4 ) ``` -------------------------------- ### Add STM32F4 Core Library Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32f4/CMakeLists.txt Defines the STM32F4 core as an INTERFACE library in CMake. ```cmake add_library(Stm32F4Core INTERFACE) ``` -------------------------------- ### Define SAMD Core Interface Library Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/samd/CMakeLists.txt Defines an INTERFACE library named 'SamdCore' to manage SAMD-specific build configurations. ```cmake add_library(SamdCore INTERFACE) ``` -------------------------------- ### Add TeensyCore Library Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/teensy/CMakeLists.txt Defines the TeensyCore library using its source files. ```cmake add_library(TeensyCore EEPROM.cpp EEPROM.h ) ``` -------------------------------- ### Log HTTP Response Reads Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Decorate a client to log all incoming HTTP response data read from the Serial port. Useful for debugging responses. ```c++ ReadLoggingStream loggingClient(client, Serial); char response[256]; loggingClient.readBytes(response, 256); // ... ``` -------------------------------- ### Compile Options for STM32F1 Core Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32f1/CMakeLists.txt Adds compile options for the STM32F1 core, specifically disabling the '-Wno-overloaded-virtual' warning. This is useful for managing compiler warnings in the STM32F1 environment. ```cmake target_compile_options(Stm32F1Core INTERFACE -Wno-overloaded-virtual ) ``` -------------------------------- ### Define doctest Library Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/doctest/CMakeLists.txt Defines the doctest library using its source files. This is a standard CMake command for creating libraries. ```cmake add_library(doctest doctest.h main.cpp ) ``` -------------------------------- ### Define SAMD Architecture Compilation Flag Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/samd/CMakeLists.txt Adds an interface compile definition 'ARDUINO_ARCH_SAMD' to the 'SamdCore' library, indicating the target architecture. ```cmake target_compile_definitions(SamdCore INTERFACE ARDUINO_ARCH_SAMD ) ``` -------------------------------- ### Set MbedRp2040Core Compile Definitions Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/mbed/CMakeLists.txt Configures compile definitions for the MbedRp2040Core library. These definitions target the RP2040 architecture and Mbed environment, enabling platform-specific code. ```cmake target_compile_definitions(MbedRp2040Core INTERFACE ARDUINO_ARCH_RP2040 ARDUINO_RASPBERRY_PI_PICO ARDUINO_ARCH_MBED_RP2040 ARDUINO_ARCH_MBED ) ``` -------------------------------- ### Reading HTTP Response with Chunk Decoding Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md This snippet demonstrates how to read an HTTP response, handling chunked transfer encoding by using ChunkDecodingStream. It's useful when you need to process the raw stream and manually deserialize JSON. ```c++ // Initialize HTTPClient HTTPClient http; http.begin(client, url); // Tell HTTPClient to collect the Transfer-Encoding header // (by default HTTPClient discards the response headers) const char *keys[] = {"Transfer-Encoding"}; http.collectHeaders(keys, 1); // Send the request int status = http.GET(); if (status != 200) return; // Create the raw and decoded stream Stream& rawStream = http.getStream(); ChunkDecodingStream decodedStream(http.getStream()); // Choose the stream based on the Transfer-Encoding header Stream& response = http.header("Transfer-Encoding") == "chunked" ? decodedStream : rawStream; // Read the response JsonDocument doc; deserializeJson(doc, response); // Close the connection http.end(); ``` -------------------------------- ### Buffer Write Operations with WriteBufferingStream Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Use WriteBufferingStream to buffer data before sending it over a stream, significantly improving performance for slow connections like WiFiClient. Remember to call flush() or rely on the destructor to send buffered data. ```c++ WriteBufferingStream bufferedWifiClient{wifiClient, 64}; serializeJson(doc, bufferedWifiClient); bufferedWifiClient.flush(); ``` -------------------------------- ### Compile Definitions for ESP8266 Core Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/esp8266/CMakeLists.txt Sets public compile definitions for the ESP8266 core library, specifically defining the architecture. ```cmake target_compile_definitions(Esp8266Core PUBLIC ARDUINO_ARCH_ESP8266 ) ``` -------------------------------- ### Set STM32 Core Compile Definitions Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32/CMakeLists.txt Defines compilation flags for the 'Stm32Core' library, including architecture and version information. ```cmake target_compile_definitions(Stm32Core PUBLIC ARDUINO_ARCH_STM32 STM32_CORE_VERSION_MAJOR=2 STM32_CORE_VERSION_MINOR=4 STM32_CORE_VERSION_PATCH=0 ) ``` -------------------------------- ### Write to a String using StringPrint Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Utilize StringPrint to capture output intended for a Print instance into a String object. This is useful when a function expects a Print object but you need the result as a String. ```c++ StringPrint stream; stream.print("Temperature = "); stream.print(22.3); stream.print(" °C"); String result = stream.str(); ``` -------------------------------- ### Add NRF52 Core Library Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/nrf52/CMakeLists.txt Defines the NRF52Core library as an INTERFACE library in CMake. ```cmake add_library(Nrf52Core INTERFACE) ``` -------------------------------- ### Add StreamUtils Test Executable Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/CMakeLists.txt Defines a function to create a test executable for StreamUtils. It links the specified core library and the doctest framework, and adds the executable as a CMake test. ```cmake function(add_streamutils_test EXECUTABLE CORE) add_executable(${EXECUTABLE} ${SOURCES}) target_link_libraries(${EXECUTABLE} ${CORE} doctest) add_test(${EXECUTABLE} ${EXECUTABLE}) endfunction() ``` -------------------------------- ### Log Read and Write Operations Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Use LoggingStream to simultaneously log both incoming and outgoing data to the Serial port. This is a combined solution for read and write logging. ```c++ LoggingStream loggingClient(client, Serial); loggingClient.println("GET / HTTP/1.1"); loggingClient.println("User-Agent: Arduino"); char response[256]; loggingClient.readBytes(response, 256); ``` -------------------------------- ### Add StreamUtils Test for Mbed Rp2040 Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/mbed/CMakeLists.txt Adds a test target named StreamUtilsTestMbedRp2040, linking it against the MbedRp2040Core library. This is used for building and running tests specific to the Mbed RP2040 environment. ```cmake add_streamutils_test(StreamUtilsTestMbedRp2040 MbedRp2040Core) ``` -------------------------------- ### Define MbedRp2040Core Library Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/mbed/CMakeLists.txt Defines the MbedRp2040Core as an INTERFACE library in CMake. This is a common practice for header-only libraries or libraries that primarily provide interface definitions. ```cmake add_library(MbedRp2040Core INTERFACE) ``` -------------------------------- ### Compile Definitions for STM32F1 Core Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32f1/CMakeLists.txt Sets the compile definition ARDUINO_ARCH_STM32F1 for the STM32F1 core. This is used by the C/C++ preprocessor to conditionally compile code specific to the STM32F1 architecture. ```cmake target_compile_definitions(Stm32F1Core INTERFACE ARDUINO_ARCH_STM32F1 ) ``` -------------------------------- ### Add STM32F1 Core Library Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32f1/CMakeLists.txt Defines the STM32F1 core as an INTERFACE library in CMake. This allows it to be linked with other targets without adding any code or data to the final executable. ```cmake add_library(Stm32F1Core INTERFACE) ``` -------------------------------- ### Add StreamUtils Test for RP2040 Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/rp2040/CMakeLists.txt Adds a test target for StreamUtils on the RP2040 core. ```cmake add_streamutils_test(StreamUtilsTestRp2040 Rp2040Core) ``` -------------------------------- ### Set TeensyCore Compile Definitions Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/teensy/CMakeLists.txt Adds the CORE_TEENSY compile definition for the TeensyCore library. ```cmake target_compile_definitions(TeensyCore PUBLIC CORE_TEENSY ) ``` -------------------------------- ### Source File Globbing Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/CMakeLists.txt Finds all .cpp source files in the current directory, with configuration dependencies. This is a common way to automatically include source files in CMake projects. ```cmake file(GLOB SOURCES CONFIGURE_DEPENDS *.cpp) ``` -------------------------------- ### Buffer Read Operations with ReadBufferingStream Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Decorate an existing Stream with ReadBufferingStream to improve read performance, especially for file operations. This is most effective when the underlying stream's readBytes() is virtual and optimized. ```c++ File file = SPIFFS.open("example.json", "r"); ReadBufferingStream bufferedFile{file, 64}; // <- HERE deserializeJson(doc, bufferedFile); ``` -------------------------------- ### Read PROGMEM buffer with ProgmemStream Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Access data stored in PROGMEM (program memory) using a Stream interface with ProgmemStream. This is useful for reading constant strings or data arrays without using RAM. ```c++ const char buffer[] PROGMEM = "This string is in program memory" ProgmemStream stream{buffer}; Serial.println(stream.readString()); ``` -------------------------------- ### Add StreamUtils Test for STM32F1 Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32f1/CMakeLists.txt Adds a test target named 'StreamUtilsTestStm32F1' that depends on the 'Stm32F1Core' library. This is part of the build system's testing infrastructure. ```cmake add_streamutils_test(StreamUtilsTestStm32F1 Stm32F1Core) ``` -------------------------------- ### Add ESP8266 StreamUtils Test Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/esp8266/CMakeLists.txt Adds a test target for StreamUtils on the ESP8266 platform. ```cmake add_streamutils_test(StreamUtilsTestEsp8266 Esp8266Core) ``` -------------------------------- ### Save JSON to EEPROM with EepromStream Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Use EepromStream to interact with a specified region of EEPROM as a stream. This allows for saving data structures like JSON documents directly to non-volatile memory. ```c++ EepromStream eepromStream(0, 128); serializeJson(doc, eepromStream); eepromStream.flush(); // <- calls EEPROM.commit() on ESP (optional) ``` -------------------------------- ### Retry Write Operations with WriteWaitingStream Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Employ WriteWaitingStream to handle streams with limited buffer capacity, ensuring data is sent by retrying write operations until successful or timed out. ```c++ WriteWaitingStream wireStream(Wire, [](){ Wire.endTransmission(false); // <- don't forget this argument Wire.beginTransmission(address); }); Wire.beginTransmission(address); wireStream.print("This is a very very long message that I'm sending!"); Wire.endTransmission(); ``` -------------------------------- ### Read JSON from EEPROM with EepromStream Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Use EepromStream to read data, such as JSON documents, from a specified region of EEPROM as if it were a stream. ```c++ EepromStream eepromStream(0, 128); deserializeJson(doc, eepromStream); ``` -------------------------------- ### Read from a String using StringStream Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Use StringStream to treat a String object as a readable Stream. This is beneficial when a function requires a Stream input but you have the data available as a String. ```c++ StringStream stream; // ... populate stream ... // Use stream as input for a function expecting a Stream ``` -------------------------------- ### Add StreamUtils Test for STM32 Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32/CMakeLists.txt Adds a test target 'StreamUtilsTestStm32' that depends on the 'Stm32Core' library. ```cmake add_streamutils_test(StreamUtilsTestStm32 Stm32Core) ``` -------------------------------- ### Add NRF52 StreamUtils Test Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/nrf52/CMakeLists.txt Adds a CMake test target named 'StreamUtilsTestNrf52' that depends on the 'Nrf52Core' library. ```cmake add_streamutils_test(StreamUtilsTestNrf52 Nrf52Core) ``` -------------------------------- ### Add StreamUtils Test for Teensy Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/teensy/CMakeLists.txt Adds a test target for StreamUtils specifically for the Teensy platform, linking against the TeensyCore library. ```cmake add_streamutils_test(StreamUtilsTestTeensy TeensyCore) ``` -------------------------------- ### Add StreamUtils Test for STM32F4 Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/stm32f4/CMakeLists.txt Adds a CMake test target named StreamUtilsTestStm32F4, linking it with the Stm32F4Core library. ```cmake add_streamutils_test(StreamUtilsTestStm32F4 Stm32F4Core) ``` -------------------------------- ### Add Parity Bits with Hamming Encoding Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Decorate a Stream with HammingEncodingStream to automatically add parity bits to outgoing data. Supports Hamming(7, 4) encoding. ```c++ HammingEncodingStream<7, 4> eccSerial(Serial1); eccSerial.println("Hello world!"); ``` -------------------------------- ### Add SAMD StreamUtils Test Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/samd/CMakeLists.txt Adds a test target named 'StreamUtilsTestSamd' that depends on the 'SamdCore' library. ```cmake add_streamutils_test(StreamUtilsTestSamd SamdCore) ``` -------------------------------- ### Decode HTTP Chunks with ChunkDecodingStream Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Use ChunkDecodingStream to decode HTTP responses that use Chunked Transfer Encoding, making the data available as a regular stream. This is essential for clients handling HTTP 1.1 responses. ```c++ ChunkDecodingStream chunkStream(httpClient); ``` -------------------------------- ### Correct Errors with Hamming Decoding Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Decorate a Stream with HammingDecodingStream to automatically decode parity bits from incoming data. Supports Hamming(7, 4) decoding. ```c++ HammingDecodingStream<7, 4> eccSerial(Serial1); char buffer[256]; size_t n = eccSerial.readBytes(buffer, n); ``` -------------------------------- ### Add DxCore Test Target Source: https://github.com/bblanchon/arduinostreamutils/blob/master/extras/test/cores/dxcore/CMakeLists.txt Adds a test target named 'StreamUtilsTestDxCore' that depends on the DxCore library. This is used for building and running tests specific to DxCore. ```cmake add_streamutils_test(StreamUtilsTestDxCore DxCore) ``` -------------------------------- ### Two-way Hamming Code Communication Source: https://github.com/bblanchon/arduinostreamutils/blob/master/README.md Use HammingStream for bidirectional communication requiring error correction. It combines encoding and decoding functionalities. ```c++ HammingStream<7, 4> eccSerial(Serial1); eccSerial.println("Hello world!"); char buffer[256]; size_t n = eccSerial.readBytes(buffer, n); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.