xref: /third_party/backends/backend/epson2-io.h (revision 141cc406)
1/*
2 * Prototypes for epson2 I/O functions
3 *
4 * Based on Kazuhiro Sasayama previous
5 * Work on epson.[ch] file from the SANE package.
6 * Please see those files for original copyrights.
7 *
8 * Copyright (C) 2006 Tower Technologies
9 * Author: Alessandro Zummo <a.zummo@towertech.it>
10 *
11 * This file is part of the SANE package.
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License as
15 * published by the Free Software Foundation, version 2.
16 */
17
18#ifndef epson2_io_h
19#define epson2_io_h
20
21extern unsigned int r_cmd_count;
22extern unsigned int w_cmd_count;
23
24
25SANE_Status e2_cmd_simple(Epson_Scanner * s, void *buf, size_t buf_size);
26int e2_send(Epson_Scanner * s, void *buf, size_t buf_size,
27		size_t reply_len, SANE_Status * status);
28ssize_t e2_recv(Epson_Scanner * s, void *buf, ssize_t buf_size,
29		    SANE_Status * status);
30
31SANE_Status
32e2_txrx(Epson_Scanner * s, unsigned char *txbuf, size_t txlen,
33	    unsigned char *rxbuf, size_t rxlen);
34
35SANE_Status
36e2_recv_info_block(Epson_Scanner * s, unsigned char *scanner_status,
37		       size_t info_size, size_t * payload_size);
38
39SANE_Status
40e2_cmd_info_block(SANE_Handle handle, unsigned char *params,
41		      unsigned char params_len, size_t reply_len,
42		      unsigned char **buf, size_t * buf_len);
43
44SANE_Status e2_ack(Epson_Scanner * s);
45SANE_Status e2_ack_next(Epson_Scanner * s, size_t reply_len);
46SANE_Status e2_cancel(Epson_Scanner * s);
47
48SANE_Status
49e2_esc_cmd(Epson_Scanner * s, unsigned char cmd, unsigned char val);
50#endif /* epson2_io_h */
51