Previous PageTable Of Contents../index.htmlIndexNext Page

dt_tstdat( )

Description | Cautions | Example | Errors | See Also

Name:

int dt_tstdat(devh,tmo)

Inputs:

int devh

  Digital Network Interface logical board device handle

 

unsigned int tmo

  timeout value

Returns:

0 on success
-1 on failure

Includes:

srllib.h
dtilib.h

Category:

Diagnostic

Mode:

synchronous/asynchronous

Top Of PageDescription

The dt_tstdat( ) function performs a test that verifies the integrity of the Digital Network Interface I/O interface to the PC. The data test is performed by sending a series of bytes to the Digital Network Interface and checking the integrity of the bytes returned.

Please note the following guidelines when using this function:

Parameter

Description

devh:

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

tmo:

Specifies the maximum amount of time in seconds that the function will block while awaiting a response from the Digital Network Interface

Asynchronous Mode

To operate this function in asynchronous (non-blocking) mode, specify 0 for tmo. This allows the application to continue processing while awaiting a completion event. If event handling is set up properly for your application, DTEV_DATRSP will be returned by the sr_getevttype( ) function included in the SRL when the test is successfully completed. See Appendix A - Standard Runtime Library for information on event handling.

Synchronous Mode

To run this function in synchronous (blocking) mode, set tmo to the length of time, in seconds, to await a return. If a response is not returned within tmo seconds, an error is returned. A suggested tmo setting for this function is 5.

Top Of PageCautions

  1. This function will return fail if:
  2. To use this function in asynchronous mode, you must use the SRL sr_enbhdlr( ) function to enable trapping of events and create an event handler to process the completion event returned by the device. The event can be detected by using the SRL event management functions. See Appendix A - Standard Runtime Library for more information on Digital Network Interface event management.

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