Jump to main content

##

# 1.2.4.4.12 SYS_CONSOLE_WriteCountGet Function

## C

    ssize_t SYS_CONSOLE_WriteCountGet(const SYS_CONSOLE_HANDLE handle)

## Summary

Returns the number of bytes pending for transmission in the transmit buffer.

## Description

This function indicates the number of bytes pending for transmission in the transmit buffer.

## Preconditions

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

## Parameters

Param | Description
--- | ---
handle | Handle to the console instance

## Returns

The return value indicates the number of bytes present in the transmit buffer waiting to be transmitted. Returns -1 in case of any error.

## Example

    ssize_t nTxBytesPending;
    SYS_CONSOLE_HANDLE myConsoleHandle;

    nTxBytesPending = SYS_CONSOLE_WriteCountGet(myConsoleHandle);

    if (nTxBytesPending == -1)
    {
        // API reported error
    }
    if (nTxBytesPending == 0)
    {
        // All the data has been written to the console
    }

## Remarks

None.