swiGetTimingReference

Retrieves the status of a potential TDM bus clock timing reference. The timing reference can be an external digital trunk or an internal oscillator.

Prototype

DWORD swiGetTimingReference ( SWIHD swihd, DWORD referencesource, DWORD network, SWI_QUERY_TIMING_REFERENCE_ARGS *args, unsigned size )

Argument

Description

swihd

Switch handle.

referencesource

Specifies which clock reference is to be queried. Refer to the Details section for acceptable values.

network

Specifies the device source for the CT bus clock signals. Refer to the Details section for acceptable values.

args

Pointer to a SWI_QUERY_TIMING_REFERENCE_ARGS clock parameter structure for querying the potential timing reference:

typedef struct
{
    DWORD status;
    DWORD statusinfo;
} SWI_QUERY_TIMING_REFERENCE_ARGS;

Refer to the Details section for a description of these fields.

size

Specifies the number of bytes contained in the structure.


Return values

Return value

Description

SUCCESS

 

CTAERR_DRIVER_ERROR

Underlying driver retrieved an unrecognized error. Call swiGetLastError to retrieve the MVIP device error code.

CTAERR_INVALID_HANDLE

swihd is not a valid switch handle.

CTAERR_SVR_COMM

Communication error in the server environment.

SWIERR_INVALID_CLOCK_PARM

Value of a clock configuration parameter is invalid.

SWIERR_INVALID_PARAMETER

Board-specific clock parameter value is invalid.


Details

swiGetTimingReference retrieves status information about a potential timing reference.

Acceptable values for referencesource are:

Acceptable values for network are 1 to n, where n is the number of devices on the specified board capable of being a clock source. A value for network is valid only when referencesource is equal to MVIP95_SOURCE_NETWORK.

The following table describes the fields in the SWI_QUERY_TIMING_REFERENCE_ARGS structure:

Field

Description

status

Status of the timing reference. Acceptable values are:

MVIP95_TIMING_REF_STATUS_GOOD

MVIP95_TIMING_REF_STATUS_BAD

MVIP95_TIMING_REF_STATUS_UNKNOWN

statusinfo

Additional optional information about the timing reference status. Acceptable values are:

MVIP95_TIMING_REF_UNKNOWN

MVIP95_TIMING_REF_NO_ALARM

MVIP95_TIMING_REF_RED_ALARM


If CTAERR_DRIVER_ERROR is returned, call swiGetLastError to retrieve the MVIP device error code.

See also

swiConfigNetrefClock, swiGetBoardClock, swiOpenSwitch

Example

void myGetTimingReference (SWIHD swihd)
{
    SWI_QUERY_TIMING_REFERENCE_ARGS   querytimingref;
    DWORD                             referencesource;
    DWORD                             network;
    unsigned                          size;

    size = sizeof (SWI_QUERY_TIMING_REFERENCE_ARGS);
    swiGetTimingReference(swihd, referencesource, network, &querytimingref,
                          size);
}