File: parallel.h

package info (click to toggle)
pyepl 1.1.0-3.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,120 kB
  • sloc: cpp: 7,986; python: 6,026; makefile: 360; ansic: 132
file content (40 lines) | stat: -rw-r--r-- 755 bytes parent folder | download | duplicates (3)
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
#ifndef PARALLEL_H
#define PARALLEL_H

#include <linux/parport.h>
#include <linux/ppdev.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <string>
#include <iostream>
#include <unistd.h>

#include <cstdlib>
#include <cstring>
#include <math.h>

using namespace std;
/* using std::string; */
/* using std::cerr; */
/* using std::endl; */

class Parallel {
  int fd;
  static const char *devstr;
  static const unsigned int numPins;
  unsigned char binaryStringToNum(unsigned char *);
 public:
  Parallel();
  ~Parallel();
  void setState(int);
  void setSignal(unsigned char *);
};

class ParallelException{
  string msg;
 public:
 ParallelException(string s):msg(s){}
  void debug_print(){ cerr << "Parallel port error: " << msg << endl; }
};

#endif