3 * Murray Jensen <Murray.Jensen@csiro.au>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 char *serialdev
= "/dev/term/b";
33 speed_t speed
= B230400
;
37 main(int ac
, char **av
)
41 if ((pname
= strrchr(av
[0], '/')) == NULL
)
46 while ((c
= getopt(ac
, av
, "b:p:v")) != EOF
)
50 if ((speed
= cvtspeed(optarg
)) == B0
)
51 Error("can't decode baud rate specified in -b option");
64 fprintf(stderr
, "Usage: %s [-b bps] [-p dev] [-v]\n", pname
);
71 fprintf(stderr
, "Opening serial port and sending continue...\n");
73 if ((sfd
= serialopen(serialdev
, speed
)) < 0)
74 Perror("open of serial device '%s' failed", serialdev
);
80 if (serialclose(sfd
) < 0)
81 Perror("close of serial device '%s' failed", serialdev
);
84 fprintf(stderr
, "Done.\n");