SetCommForYMODEM

This function is used to set up the communication parameters (baud rate, parity, and stop bit) to be used by the YMODEM library.

Before this function is called, the COM port must have been opened by the OpenYMODEM function.

SYNTAX

#include "ymodem.h"

short WINAPI _export SetCommForYMODEM( long lBaud, short iParity,

 

short iStopBits )

INPUT

 

lBaud

= Select from 1200, 2400, 4800, 9600 (default),14400, 19200, 38400,

 

57600, and 115200 bps.

iParity

= Select from NOPARITY(default), ODDPARITY, and

 

EVENPARITY.

iStopBits = Select either ONESTOPBIT(Default) or TWOSTOPBITS.

OUTPUT

 

= 0

Normal termination

= Other

Refer to the error code table.

￿Note:

NOPARITY/ODDPARITY/EVENPARITY/ONESTOPBIT/TWOSTOPBITS have been defined in windows.h as the following values. If calling this library (DLL) from Visual Basic, directly specify their values.

#define NOPARITY

0

#define ODDPARITY

1

#define

EVENPARITY

2

#define

ONESTOPBIT

0

￿#define TWOSTOPBITS 2

If a value not permitted for each parameter is specified, the default value of the item will be used. If, for example, "123" is specified as the baud rate, it does not cause an error, but the default value of 9600 bps is automatically used.

237

Page 237
Image 237
Casio IT-2000W manual SetCommForYMODEM, Evenparity