
Description | Cautions | Example | Source Code | Errors | See Also
Name: |
int fx_sendraw(faxname, width, resln, phdcont) | |
Inputs: |
char * faxname |
name of raw file to send |
|
unsigned short width |
carriage width to send the data |
|
unsigned char resln |
vertical resolution to send data |
|
unsigned char phdcont |
Phase D continuation value |
Returns: |
0 if success | |
|
-1 if failure | |
Includes: |
srllib.h | |
|
dxxxlib.h | |
|
faxlib.h | |
Category: |
send fax | |
Mode: |
synchronous | |
|
||
The fx_sendraw( ) function allows an application to send a single page of raw fax data, unformatted MH Group 3 data at the width and resolution specified by the function parameters.
This function is a convenience function and is resident in faxconv.c. The fx_sendraw( ) function calls fx_sendfax( ) as illustrated in the source code for fx_sendraw( ). For detailed information on Phase D continuation values, status information and file error handling that applies to fx_sendraw( ), see the fx_sendfax( ) function reference.
The encoding scheme used in transmitting fax data varies by product; for more information, see Section 2.4. Key Product Features on page 8. The preferred encoding scheme for transmission is determined by the value set in the FC_TXCODING parameter in fx_setparm( ).
#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
int voxhandle; /* Voice channel device handle. */
int devhandle; /* Fax channel device handle. */
/*
* Open the channel using dx_open( ) to obtain the Dialogic
* VOICE device handle in voxhandle.
* Open the channel using fx_open( ) to obtain the FAX channel
* device handle in devhandle.
*/
/*
* Take channel offhook using dx_sethook( ) and perform outbound
* dial using dx_dial( ).
*/
.
.
/*
* Set the fax state of the channel to DF_TX using
* fx_initstat( ).
*/
.
.
/*
* Transmit raw document at page width 1728 pixels per line
* at low (coarse) vertical resolution and disconnect when
* finished.
*/
if (fx_sendraw("document.raw",DF_WID1728,DF_RESLO,DFC_EOP) == -1 {
printf("Error code: %ld Error message: %s\n",
ATDV_LASTERR(devhandle), ATDV_ERRMSGP(devhandle));
if (ATDV_LASTERR(devhandle) == EDX_SYSTEM) {
/* Perform system error processing */
}
printf("Phase E status: %ld\n", ATFX_ESTAT(devhandle));
}
/*
* NOTE: devhandle is a global variable of type int. Prior to
* calling fx_sendraw( ), the channel is opened using
* fx_open( ) to obtain the Dialogic FAX channel device handle in
* devhandle.
*/
DF_IOTT iott;
int fx_sendraw(faxname,width,resln,phdcont)
char * faxname;
unsigned short width;
unsigned char resln;
unsigned char phdcont
{
int erc;
/* Open the file as read-only. */
if ((iott.io_fhandle = dx_fileopen(faxname,O_RDONLY|O_BINARY,0)) == -1) {
return(-1);
}
/*
* Set up the DF_IOTT structure as the default and then
* change the necessary fields.
*/
fx_setiott(&iott,iott.io_fhandle,DF_RAW,phdcont);
iott.io_type |= IO_EOT;
iott.io_width = width;
iott.io_resln = resln;
erc = fx_sendfax(devhandle,&iott, EV_SYNC)
dx_fileclose(iott.fhandle);
return(erc);
}
See Appendix D for a list of error codes that may be returned for this function.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation