Initialize Packet Mode - VeriFone MX800 series Programmer's Manual

Hide thumbs Also See for MX800 series:
Table of Contents

Advertisement

Initialize Packet Mode

Prior to reading or writing messages in packet mode, startPktMode() must be
called to configure the packet mode parameters. The packet_parms structure
(in struct Opn_Blk) must be correctly completed before calling
StartPktMode(). Opening the ECR using ecrOpen() is automatically set. If
packet mode is required on a port that is not opened with ecrOpen(), then the
application is required to fill in this structure.
/* --------------------- Packet Defines --------------------------*/
typedef struct
{
unsigned char stx_char; // Define start character
unsigned char etx_char; // Define end character
unsigned char count; // Define number of characters for error
check
int max_pkt; // Maximum message length in bytes
void (*pPktHandler) (char *, int); // RX message callback function
} packet_parm_t;
Prototype
int startPktMode(int hCom, struct Opn_Blk *openBlock);
Parameters
Handle of a previously opened serial port
hCom
Serial communication control structure
openBlock
Return Values
0
Successful execution
< 0
Error
D
Initialize Packet Mode
X
M
800 S
P
ERIES
ROGRAMMERS
D
EVICE
RIVERS
95
G
UIDE

Advertisement

Table of Contents
loading

Table of Contents