
Description | Cautions | Example | Errors
Name: |
int fx_getparm(dev,parm,valuep) | |
Inputs: |
int dev |
fax channel device handle |
|
unsigned long parm |
parameter |
|
void *valuep |
pointer location to store parameter value |
Returns: |
0 if success | |
|
-1 if failure | |
Includes: |
srllib.h | |
|
dxxxlib.h | |
|
faxlib.h | |
Category: |
configuration | |
Mode: |
synchronous | |
|
||
The fx_getparm( ) function returns the current parameter setting for an open fax channel device.
Parameter |
Description |
dev |
Specifies the device handle returned for the fax channel when the channel was opened. |
parm |
Specifies the define for the parameter ID whose value is returned in the location pointed to by valuep. |
valuep |
Points to the location where the parm value is stored. |
Many of the same parameter IDs are available for fx_setparm( ) and fx_getparm( ); any differences are noted. The fx_getparm( ) function allows you to retrieve parameters set for an open fax channel device, and the fx_getparm( ) function allows you to configure a channel device. For details on parameter IDs, see the fx_setparm( ) function reference.
The address of the variable passed to receive the value of the requested parameter must be cast as (void *) as shown in the example. Dialogic also recommends that you clear this variable prior to calling fx_getparm( ).
Allocate sufficient memory to receive the value of the parameter specified. Note that some parameters require only 2 bytes while other parameters may be ASCII strings.
Do not use the voice driver library function dx_getparm( ) to retrieve fax parameter values.
Example
1: fx_getparm( ) and FC_RETRYCNT#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
int dev;
unsigned short value;
/* Clear value. */
value = 0;
/*
* Open device using fx_open( ). Obtain Dialogic FAX device
* handle in dev.
*/
.
.
/*
* FC_RETRYCNT parameter uses 2 bytes. Pass the address of
* the variable value (unsigned short) to fx_getparm( ).
*/
if (fx_getparm(dev,FC_RETRYCNT,(void *)&value) == -1) {
/* Error processing. */
printf("Error - %s (error code %d)\n", ATDV_ERRMSGP(dev),
ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
}
printf("Number of retries was %ld\n",value);
Example
2: fx_getparm( ) and FC_FONT0#include <windows.h>
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
int dev;
HFONT hMyFont;
/*
* Open device using fx_open( ). Obtain Dialogic fax device handle in dev.
*/
.
.
.
/* pass the handle to the fax library as one of the 2 internal fonts.*/
if (fx_getparm(dev,FC_FONT0,(void *)&hMyFont) == -1) {
printf("Error - %s (error code %d)\n", ATDV_ERRMSGP(dev),
ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev) == EDX_SYSTEM) {
/* Perform system error processing */
}
}
See Appendix D for a list of error codes that may be returned for this function.
If you issue this function for a parameter that is not supported by your fax hardware channel, ATDV_LASTERR( ) returns an EFX_UNSUPPORTED error code.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation