1.2.4.4.9 SYS_CONSOLE_ReadFreeBufferCountGet Function

C

ssize_t SYS_CONSOLE_ReadFreeBufferCountGet(const SYS_CONSOLE_HANDLE handle)

Summary

Returns the amount of free space in bytes available in the receive buffer.

Description

This function indicates the number of free space available in the receive buffer, thereby indicating the number of bytes that can be received without overflowing the receive buffer.

Preconditions

The SYS_CONSOLE_Initialize function should have been called before calling this function.

Parameters

ParamDescription
handleHandle to a valid console instance

Returns

The return value indicates the number of bytes of free space available in the receive buffer. Returns -1 in case of any error.

Example

ssize_t nr;
SYS_CONSOLE_HANDLE myConsoleHandle;

// myConsoleHandle is assumed to be a valid console handle
nr = SYS_CONSOLE_ReadFreeBufferCountGet(myConsoleHandle);
if (nr == -1)
{
    // Handle error
}

Remarks

None.