Streams#
Defined in namespace hal
#include <libhal-util/streams.hpp>
- group Streams
Functions
-
explicit stream_find(std::span<const hal::byte> p_sequence)#
Construct a new find object.
- Parameters:
p_sequence – - sequence to search for. The lifetime of this data pointed to by this span must outlive this object, or not be used when the lifetime of that data is no longer available.
-
explicit stream_fill(std::span<hal::byte> p_buffer)#
Construct a new fill object.
- Parameters:
p_buffer – - buffer to read data into
-
stream_fill(std::span<hal::byte> p_buffer, const size_t &p_fill_amount)#
Construct a new fill object.
- Parameters:
p_buffer – - buffer to read data into
p_fill_amount – - reference to a size value to limit the fill amount by.
-
stream_fill_upto(std::span<const hal::byte> p_sequence, std::span<hal::byte> p_buffer)#
Construct a new fill upto object.
- Parameters:
p_sequence – - sequence to search for. The lifetime of this data pointed to by this span must outlive this object, or not be used when the lifetime of that data is no longer available.
p_buffer – - buffer to fill data into
-
explicit stream_parse() = default#
Construct a new parse object.
-
explicit stream_skip(size_t p_skip)#
Construct a new skip object.
-
class stream_find#
- #include <streams.hpp>
Discard received bytes until the sequence is found.
Public Functions
-
class stream_fill#
- #include <streams.hpp>
Non-blocking callable for reading serial data into a buffer.
-
class stream_fill_upto#
- #include <streams.hpp>
Discard received bytes until the sequence is found.
Public Functions
-
stream_fill_upto(std::span<const hal::byte> p_sequence, std::span<hal::byte> p_buffer)#
Construct a new fill upto object.
- Parameters:
p_sequence – - sequence to search for. The lifetime of this data pointed to by this span must outlive this object, or not be used when the lifetime of that data is no longer available.
p_buffer – - buffer to fill data into
-
stream_fill_upto(std::span<const hal::byte> p_sequence, std::span<hal::byte> p_buffer)#
-
template<std::unsigned_integral T>
class stream_parse# - #include <streams.hpp>
Read bytes from stream and convert to integer.
-
explicit stream_find(std::span<const hal::byte> p_sequence)#