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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta name="robots" content="noindex">
<title>pcomm.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.0.0 on Mon Jan 17 00:45:27 2000 -->
<center>
<a class="qindex"href="index.html">Main Page</a> <a class="qindex"href="annotated.html">Compound List</a> <a class="qindex"href="files.html">File List</a> <a class="qindex"href="headers.html">Header Files</a> <a class="qindex"href="sources.html">Sources</a> <a class="qindex"href="functions.html">Compound Members</a> <a class="qindex"href="globals.html">File Members</a> </center>
<hr><h1>pcomm.h</h1><div class="fragment"><pre>00001 #ifndef PCOMM_H_
00002 #define PCOMM_H_
00003 /*
00004 Copyright (C) 1999 PolyWog and Javaman for Ghetto.Org
00005 This file is part of the PCR-1000 API Library.
00006
00007 The PCR-1000 API Library is free software; you can redistribute it and/or
00008 modify it under the terms of the GNU Library General Public License as
00009 published by the Free Software Foundation; either version 2 of the
00010 License, or (at your option) any later version.
00011
00012 The PCR-1000 API Library is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00015 Library General Public License for more details.
00016
00017 You should have received a copy of the GNU Library General Public
00018 License along with the PCR-1000 API Library; see the file LICENSE. If not,
00019 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020 Boston, MA 02111-1307, USA.
00021 */
00022
00023 #include <sys/types.h>
00024 #include <sys/stat.h>
00025 #include <fcntl.h>
00026 #include <sys/termios.h>
00027 #include <stdio.h>
00028 #include <unistd.h>
00029 #include <sys/time.h>
00030 #include <stdlib.h>
00031
00032 #include "pcrdef.h"
00033
<a name="l00034"><a class="code" href="pcomm.h.html#a0">00034</a></a> #define BAUDRATE B9600
<a name="l00035"><a class="code" href="pcomm.h.html#a1">00035</a></a> #define PCRDEV "/dev/ttyS0"
<a name="l00036"><a class="code" href="pcomm.h.html#a2">00036</a></a> #define _POSIX_SOURCE 1 /* POSIX compliant source */
00037
<a name="l00038"><a class="code" href="pcomm.h.html#a3">00038</a></a> typedef int size_pc; /* i/o count confirmation */
00039
00041
<a name="l00047"><a class="code" href="class_pcomm.html">00047</a></a> class <a class="code" href="class_pcomm.html">PComm</a> {
00048 public:
00049 <a class="code" href="class_pcomm.html#a0">PComm</a>(char *pcrDev, tcflag_t baudRate=B9600, const char *name=0);
00050 <a class="code" href="class_pcomm.html#a1">~PComm</a>();
00051
00052 bool <a class="code" href="class_pcomm.html#a2">PCOpen</a>(const char *pcrDev=PCRDEV, tcflag_t baudRate=B9600);
00053 void <a class="code" href="class_pcomm.html#a3">PCClose</a>();
00054
00055 size_pc <a class="code" href="class_pcomm.html#a4">PCTell</a>(char *);
00056 size_pc <a class="code" href="class_pcomm.html#a5">PCAsk</a>(char *);
00057 size_pc <a class="code" href="class_pcomm.html#a6">PCHear</a>(char *);
00058 size_pc <a class="code" href="class_pcomm.html#a7">PCRawWrite</a>(char *);
00059 size_pc <a class="code" href="class_pcomm.html#a8">PCRawRead</a>(char *);
00060
00061 private:
00062 size_pc <a class="code" href="class_pcomm.html#c0">Write</a>(char *);
00063 size_pc <a class="code" href="class_pcomm.html#c1">Read</a>(char *);
00064
00065 void <a class="code" href="class_pcomm.html#c2">resetCall</a>();
00066 void <a class="code" href="class_pcomm.html#c3">countCall</a>();
<a name="l00068"><a class="code" href="class_pcomm.html#c4">00068</a></a> int callCount;
<a name="l00070"><a class="code" href="class_pcomm.html#c5">00070</a></a> char callBuf[256];
00071
<a name="l00073"><a class="code" href="class_pcomm.html#c6">00073</a></a> struct timeval *timeOut;
<a name="l00075"><a class="code" href="class_pcomm.html#c7">00075</a></a> fd_set *FDSet;
<a name="l00077"><a class="code" href="class_pcomm.html#c8">00077</a></a> int retVal;
<a name="l00079"><a class="code" href="class_pcomm.html#c9">00079</a></a> struct termios *oldtio;
<a name="l00081"><a class="code" href="class_pcomm.html#c10">00081</a></a> struct termios *newtio;
<a name="l00083"><a class="code" href="class_pcomm.html#c11">00083</a></a> int fd;
<a name="l00085"><a class="code" href="class_pcomm.html#c12">00085</a></a> char pcrDevice[256];
<a name="l00087"><a class="code" href="class_pcomm.html#c13">00087</a></a> tcflag_t pcrSpeed;
00088
<a name="l00090"><a class="code" href="class_pcomm.html#c14">00090</a></a> bool errRead;
<a name="l00092"><a class="code" href="class_pcomm.html#c15">00092</a></a> bool errWrite;
<a name="l00094"><a class="code" href="class_pcomm.html#c16">00094</a></a> char askBuf[256];
<a name="l00096"><a class="code" href="class_pcomm.html#c17">00096</a></a> char hearBuf[256];
<a name="l00098"><a class="code" href="class_pcomm.html#c18">00098</a></a> char writeBuf[256];
<a name="l00100"><a class="code" href="class_pcomm.html#c19">00100</a></a> char readBuf[256];
<a name="l00102"><a class="code" href="class_pcomm.html#c20">00102</a></a> char int_name[256];
<a name="l00104"><a class="code" href="class_pcomm.html#c21">00104</a></a> size_pc writeCtr;
<a name="l00106"><a class="code" href="class_pcomm.html#c22">00106</a></a> size_pc readCtr;
<a name="l00108"><a class="code" href="class_pcomm.html#c23">00108</a></a> size_pc askCtr;
<a name="l00110"><a class="code" href="class_pcomm.html#c24">00110</a></a> size_pc tellCtr;
<a name="l00112"><a class="code" href="class_pcomm.html#c25">00112</a></a> size_pc hearCtr;
00113 };
00114
00115 #endif /* PCOMM_H_ */
</div></pre><hr><address><small>Generated at Mon Jan 17 00:45:27 2000 for Icom PCR-1000 Library by
<a href="http://www.stack.nl/~dimitri/doxygen/index.html">
<img src="doxygen.gif" alt="doxygen" align=center border=0
width=118 height=53></a> 1.0.0 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
© 1997-1999</small></address>
</body>
</html>
|