Previous PageTable Of ContentsHomeIndexNext Page

sr_setparm( )

Description | Cautions | Example | Errors | See Also

Name:

long sr_setparm(dev, parmno, parmval)

Inputs:

long dev

  device handle

 

long parmno

  parameter number

 

void *parmval

  pointer to parameter value

Returns:

0 if successful

 

-1 if failure

Includes:

srllib.h

Type:

SRL Parameter function

Top Of PageDescription

The sr_setparm( ) function allows the application to set the value of an SRL parameter. Usually, this function's parameters govern the mode of operation for eventing and synchronization. The function parameters are described as follows:

Parameter

Description

dev

Device handle. Generally, you should set this parameter to SRL_DEVICE, which is the predefined SRL device handle. However, if the parameter being set is SR_USERCONTEXT, then dev should be set to the handle returned by the technology-specific xx_open( ).

parmno

Value for the SRL parameter to be changed. Possible values are as follows:

 

  SR_MODELTYPE

Set the model type to turn off creation of internal thread used to service event handler action

 

  SR_INTERPOLLID

Set the polling granularity parameter (the time between device polls expressed in milliseconds).

 

  SR_USERCONTEXT

Set user-specific context. This lets you quickly set application-specific context on a given Dialogic device handle.

 

  SR_WIN32INFO

Set the Win32 integration mode. (See below.)

parmval

A pointer to an area of memory that contains the value for the specified parameter.

 

  SR_MODELTYPE

The value is expected to point to an integer that contains SR_STASYNC or SR_MTASYNC.

 

  SR_INTERPOLLID

The value is expected to point to an integer that contains the polling granularity expressed in millisecond (ms) units.

 

  SR_USERCONTEXT

The value is expected to point to arbitrary user-supplied data.

 

  SR_WIN32INFO

The value is expected to point to either an SRLWIN32INFO structure that indicates the Win32 synchronization method or to NULL to disable Win32 notification.

For more information on Win32 integration and on use of the SR_WIN32INFO parameter, see section 5.5. Asynchronous with Win32 Synchronization Model.

Top Of PageCautions

Normally, when setting SRL parameters, you must set the dev parameter to SRL_DEVICE. However, if you set the parmno parameter to SR_USERCONTEXT, you must set the dev parameter to the device on which context is being retrieved.

Top Of PageExample

The following example calls the sr_setparm( ) function with its parmno parameter set to SR_USERCONTEXT:

The following example uses Win32 notification through an I/O Completion Port:

Top Of PageErrors

If this function returns -1 to indicate failure, obtain the reason for the error by calling the SRL standard attribute function ATDV_LASTERR(SRL_DEVICE) or ATDV_ERRMSGP(SRL_DEVICE) to retrieve either the error code or a pointer to the error description, respectively. One of the following errors may be returned:

ESR_SYS

  Error from operating system; use dx_fileerrno( ) to obtain error value.

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 January, 2001