Previous PageTable Of Contents../index.htmlIndexNext Page

dt_rundiag( )

Description | Cautions | Example | Errors | See Also

Name:

int dt_rundiag(devh,tmo,diagbufp)

Inputs:

int devh

  Digital Network Interface logical board device handle

 

int tmo

  Timeout value

 

char *diagbufp

  Pointer to 1 byte buffer for diagnostic code

Returns:

0 on success
-1 on failure

Includes:

srllib.h
dtilib.h

Category:

Diagnostic

Mode:

synchronous/asynchronous

Top Of PageDescription

The dt_rundiag( ) function runs diagnostics on the Network firmware. The function can operate in synchronous (blocking) or asynchronous (non-blocking) mode.

Please note the following guidelines when using this function:

Parameter

Description

devh:

Specifies the valid Digital Network Interface board device handle returned by a call to dt_open( )

tmo:

When operating the function in synchronous mode, specifies the length of time in seconds the function will block while waiting for a response from the device

diagbufp:

Pointer to a one-byte data buffer to which the diagnostic code will be returned when the function is operating in synchronous mode

Synchronous Mode

To operate the function in synchronous (blocking) mode, specify in tmo the length of time in seconds that the function will block. This causes the application to await a return from the function before performing any other processing. A suggested setting for tmo is 5.

Asynchronous Mode

To operate the function in asynchronous (non-blocking) mode, set tmo to 0. This allows the application to continue processing while awaiting a completion event from the device.

If event handling is set up properly for your application, DTEV_RETDIAG is returned by the SRL sr_getevttype( ) function when the diagnostics are successfully completed.

To use this function in asynchronous mode, you must use the SRL sr_enbhdlr( ) function to enable trapping of the event and create an event handler to process the completion event returned by the device. See Appendix A - Standard Runtime Library for more information on Digital Network Interface event management.

NOTE:
To run this function in asynchronous operation, you must pass a NULL pointer to diagbufp.

Diagnostic Return Codes

The diagnostic codes listed below provide results of the diagnostics run on the Digital Network Interface firmware. In synchronous mode, the diagnostic codes are returned to the one-byte buffer pointed to by diagbufp. In asynchronous mode, the codes are returned by the SRL sr_getevtdatap( ) function.

Top Of PageCautions

  1. This function will fail under the following conditions:
  2. Make sure all time slots are closed and idle. This function is destructive to calls in progress.

Top Of PageExample

Top Of PageErrors

If the function returns -1, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive error message. See Appendix A - Standard Runtime Library for more information on SRL functions. The error codes returned by ATDV_LASTERR( ) are:

Error defines can be found in the file dtilib.h.

Top Of PageSee Also


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2001, Dialogic Corporation
All rights reserved
This page generated November, 2001