Back to Aurora Vision Library Lite website

You are here: Start » System » Serial Port » SerialPort_ReadStringUntil

SerialPort_ReadStringUntil


Header: STD.h
Namespace: avl

Reads the string from the serial port to encounter a string delimiter.

Syntax

void avl::SerialPort_ReadStringUntil
(
	SerialPortState& ioState,
	int inPortId,
	const atl::String& inEndString,
	atl::Conditional<atl::String>& outString
)

Parameters

Name Type Range Default Description
Input will be modified ioState SerialPortState& Object used to maintain state of the function.
Input value inPortId int 0 - 7 0 Identifies open port instance when working with multiple serial ports
Input value inEndString const String& Delimiter string that will be searched in incoming stream.
Output value outString Conditional<String>& Conditionally returns received string without delimiter.

Description

Filter reads characters from input buffer until find inEndString delimiter is found. Returns data without delimiter.

Result string will be read in UTF8 format.

Delimiter provided in inEndString must contains only ASCII characters.

Filter perform non-blocking reading form buffer and will return NIL when no data was read.

Remarks

Using the SerialPort_Config filter is necessary before using the SerialPort_ReadStringUntil filter.

Filter SerialPort_Config does not guarantee that input buffer will be empty.

Errors

Using filters reading from serial port without previous configuration will cause "SerialPort not initialized" error.

List of possible exceptions:

Error type Description
DomainError inEndString must contains only ASCII characters.
Termination string must contain only ASCII characters.

See Also