chiark / gitweb /
Modify for new transport configuration. Set PowerJog parameters as the
[jog] / tx-serial-unix.h
1 /* -*-c-*-
2  *
3  * $Id: tx-serial-unix.h,v 1.2 2002/01/30 09:25:15 mdw Exp $
4  *
5  * Unix/POSIX serial port transport
6  *
7  * (c) 2001 Mark Wooding
8  */
9
10 /*----- Licensing notice --------------------------------------------------* 
11  *
12  * This file is part of Jog: Programming for a jogging machine.
13  *
14  * Jog is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  * 
19  * Jog is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  * 
24  * You should have received a copy of the GNU General Public License
25  * along with Jog; if not, write to the Free Software Foundation,
26  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27  */
28
29 /*----- Revision history --------------------------------------------------* 
30  *
31  * $Log: tx-serial-unix.h,v $
32  * Revision 1.2  2002/01/30 09:25:15  mdw
33  * Modify for new transport configuration.  Set PowerJog parameters as the
34  * default.
35  *
36  * Revision 1.1  2002/01/25 19:34:45  mdw
37  * Initial revision
38  *
39  */
40
41 #ifndef TX_SERIAL_UNIX_H
42 #define TX_SERIAL_UNIX_H
43
44 #ifdef __cplusplus
45   extern "C" {
46 #endif
47
48 /*----- Header files ------------------------------------------------------*/
49
50 #ifdef HAVE_CONFIG_H
51 #  include "config.h"
52 #endif
53
54 #ifndef TXPORT_H
55 #  include "txport.h"
56 #endif
57
58 /*----- Functions provided ------------------------------------------------*/
59
60 /* --- @txsu_shutdown@ --- *
61  *
62  * Arguments:   ---
63  *
64  * Returns:     ---
65  *
66  * Use:         Restores terminal settings on exit.
67  */
68
69 extern void txsu_shutdown(void);
70
71 extern txport *txsu_create(const char */*file*/);
72 extern int txsu_configure(txport */*txg*/,
73                           const char */*k*/, const char */*v*/);
74 extern void *txsu_fetch(void */*txv*/);
75 extern ssize_t txsu_write(txport */*txg*/,
76                             const void */*p*/, size_t /*sz*/);
77 extern void txsu_destroy(txport */*txg*/);
78
79 #ifdef TX_LIST
80    static const struct txfile txsu_fv[] = {
81      { "JOGSERIAL", 0 },
82      { 0, "/dev/ttyS0" },
83    };
84
85    static txport_ops txsu_ops = {
86      TX_LIST, "serial-unix", txsu_fv,
87      "flow=none;baud=9600;format=8-odd-1;newline=cr",
88      txsu_create, txsu_configure, txsu_fetch, txsu_write, txsu_destroy
89    };
90 #  undef TX_LIST
91 #  define TX_LIST &txsu_ops
92 #endif
93
94 /*----- That's all, folks -------------------------------------------------*/
95
96 #ifdef __cplusplus
97   }
98 #endif
99
100 #endif