File: serial.h

package info (click to toggle)
slbreflex 2.2.0-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 184 kB
  • ctags: 200
  • sloc: ansic: 1,523; makefile: 79; sh: 73
file content (70 lines) | stat: -rw-r--r-- 1,447 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef _serial_h_
#define _serial_h_

/*
 *
 * $Id: serial.h,v 1.2 1999/06/07 22:37:30 corcoran Exp $
 *
 * NAME:
 *	serial.h - Copyright (C) 1998 David Corcoran
 *             corcordt@cs.purdue.edu
 *
 * DESCRIPTION:
 *      This provides Unix/Mac serial interface drivers.
 *
 * AUTHOR:
 *	David Corcoran, 3/17/98
 *
 * LICENSE: See file LICENSE.
 *
 */

#include "defines.h"

bool
IO_InitializePort(	/* Initialize the card reader port.	*/
	int baud,	/* Baud rate to set port to		*/
	int bits,	/* Bytesize: 5, 6, 7 or 8		*/
	char par,	/* Parity: 'E' even, 'O' odd, 'N' none	*/
	char* port	/* Name of port, or (char *)0L for dialog */
);

HANDLE
IO_ReturnHandle(        /* Returns the current handle           */
	void
);

int 
IO_UpdateReturnBlock(   /* Returns the current blocking time    */
	int blocktime   /* The updated blocking time            */
);

int
IO_ReturnBaudRate(      /* Return the current baudrate          */
	void
);

bool			/* True for sucess, false otherwise	*/
IO_FlushBuffer(		/* Flush buffer to card reader		*/
	void
);

bool
IO_Read(		/* Read up to 256 bytes from the port	*/
	int readsize,   /* Number of bytes to read		*/
	BYTE *response  /* Bytes read                           */
);	

bool    
IO_Write(
	BYTE c          /* Byte to be written                   */
);

bool			/* True for success, false otherwise */
IO_Close(			/* On a Mac, gotta close the port */
	void
);

#define DATA_DUMP_FILE "dump"

#endif