~ubuntu-branches/ubuntu/quantal/linpsk/quantal

« back to all changes in this revision

Viewing changes to linpsk/input.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Bruce Walker
  • Date: 2002-02-06 11:43:38 UTC
  • Revision ID: james.westby@ubuntu.com-20020206114338-xqmjmhh01lpjm0g4
Tags: upstream-0.6.2
ImportĀ upstreamĀ versionĀ 0.6.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                          input.cpp  -  description
 
3
                             -------------------
 
4
    begin                : Sat May 5 2001
 
5
    copyright            : (C) 2001 by Volker Schroer
 
6
    email                : DL1KSV@gmx.de
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 ***************************************************************************/
 
16
 
 
17
#include "input.h"
 
18
#include <errno.h>
 
19
Input::Input(int ptt)
 
20
{
 
21
fd = -1;
 
22
serial=ptt;
 
23
}
 
24
Input::~Input()
 
25
{
 
26
}
 
27
 
 
28
 /** Opens the Device named Device for reading */
 
29
 
 
30
bool Input::open_Device_read(QString Device)
 
31
{
 
32
fd = open(Device,O_RDONLY);
 
33
if (fd > 0)
 
34
        return true;
 
35
else
 
36
        return false;
 
37
}
 
38
 
 
39
  /** Closes the open Device */
 
40
bool Input::close_Device()
 
41
{
 
42
int i;
 
43
if (fd >= 0)
 
44
        i=close(fd);
 
45
        if ( i!=0)
 
46
                i=errno;
 
47
fd = -1;
 
48
return true;
 
49
}
 
50
 
 
51
 
 
52
        
 
53