Jump to main content

##

# TCPIP_STACK_NetMACRegisterStatisticsGet Function

## C

    bool TCPIP_STACK_NetMACRegisterStatisticsGet(
        TCPIP_NET_HANDLE netH,
        TCPIP_MAC_STATISTICS_REG_ENTRY* pRegEntries,
        int nEntries,
        int* pHwEntries
    );

## Description

This function returns the hardware statistics register data of the MAC that is attached to the specified network interface.

## Preconditions

The TCP/IP stack should have been initialized by TCPIP_STACK_Initialize() and the TCPIP_STACK_Status() returned SYS_STATUS_READY. The network interface should be up and running.

## Parameters

Parameters | Description
--- | ---
netH | Handle of the interface to use.
pRegStatistics | Pointer to a pRegEntries that will receive the current hardware statistics registers values. Can be 0, if only the number of supported hardware registers is requested.
nEntries | Provides the number of TCPIP_MAC_STATISTICS_REG)ENTRY structures present in pRegEntries. Can be 0, if only the number of supported hardware registers is requested. The register entries structures will be filled by the driver, up to the supported hardware registers.
pHwEntries | Pointer to an address to store the number of the statistics registers that the hardware supports. It is updated by the driver. Can be 0 if not needed.

## Returns

- True - If the call succeeded.
- False - If the call failed (the corresponding MAC does not implement hardware statistics counters).

## Remarks

If the netH refers to an alias interface, the MAC register statistics of the primary interface are returned.

## Example

    TCPIP_MAC_REG_STATISTICS regStatistics;
    TCPIP_NET_HANDLE netH = TCPIP_STACK_NetHandleGet("PIC32INT");
    if(TCPIP_STACK_NetMACRegisterStatisticsGet(netH, &regStatistics))
    {
        // display the hardware statistics registers for the internal PIC32 MAC attached to this interface
    }