Previous PageTable Of Contents../index.htmlIndexNext Page

dt_tstcom( )

Description | Cautions | Example | Errors | See Also

Name:

int dt_tstcom(devh,tmo)

Inputs:

int devh

  Digital Network Interface logical board device handle

 

int tmo

  timeout value

Returns:

Digital Network Interface return code
-1 on failure

Includes:

srllib.h
dtilib.h

Category:

Diagnostic

Mode:

synchronous/asynchronous

Top Of PageDescription

The dt_tstcom( ) function tests the ability of a Digital Network Interface device to communicate with the host PC. This function can operate in either 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 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 waiting for a response from the Digital Network Interface. If a response is not returned within tmo seconds, an error is returned

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.

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_COMRSP 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.

Top Of PageCautions

  1. This function returns a failure under the following conditions:
    NOTE:
    Device configuration information is found in the appropriate hardware installation card (see Appendix D).
  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.

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