Developing a Fax Application

args_page.length = 1143; args_page.ascii_pad = 1; BfvFaxPageParams(lp,&args_page);

Sets the page parameters: no top or bottom margins, a page length of 1143 (normal) G3 lines, and no padding of short ASCII pages, no padding of short images, no breaking of images, and no margins for images.

BT_ZERO(args_fax);

args_fax.resolution = RES_200H_100V; args_fax.width = WIDTH_A4; BfvFaxBeginSendRaw(lp, &args_fax);

Begins the handshaking procedure and indicates that the first page is in normal resolution and has A4 width.

BfvFaxGetRemoteInfo(lp, &args_fax);

Waits for the called machine to send its ID and capabilities.

BfvFaxWaitForTraining(lp, &args_fax);

Waits for the completion of the Phase B handshaking procedure.

BT_ZERO(args_strip);

args_strip.fmt = FMT_MMR_ALIGN_MSB; args_strip.resolution = RES_200H_100V; args_strip.width = WIDTH_A4; BfvFaxStripParams(lp,&args_strip);

Sets the G3 parameters for the G3 document mmrdoc.g3, since the data format differs from the default (MH).

BT_ZERO(args_fax);

args_fax.fname = "mmrdoc.g3"; args_fax.fmt = FMT_MMR_ALIGN_MSB; BfvFaxSendFile(lp, &args_fax);

Sends the G3 document data file mmrdoc.g3 stored on disk in MMR format, to the driver.

BfvFaxEndOfDocument(lp, &args_fax);

Indicates to the driver that this page is the last page of the transmission.

BT_ZERO(args_admin);

BfvLineDetach (lp, &args_admin);

Frees all the memory for the attached line and closes the device.

November 2009

82

Page 82
Image 82
Dialogic 6.2 manual BTZEROargsstrip