Map27
 All Classes Functions Variables Enumerations Enumerator Pages
UnixPort.h
1 // UnixPort.h
2 //
3 // Author: Mike McCauley (mikem@airspayce.com)
4 // Copyright (C) 2013 Mike McCauley
5 // $Id: UnixPort.h,v 1.4 2013/07/13 11:28:33 mikem Exp $
6 
7 #ifndef MAP27_UNIXPORT_H
8 #define MAP27_UNIXPORT_H
9 
10 #include <stdint.h>
11 #include <termios.h>
12 
13 #include"Port.h"
14 
24 class Map27UnixPort : public Map27Port
25 {
26 public:
27 
30  Map27UnixPort();
31 
35  void setDevice(const char* device);
36 
39  const char* device();
40 
43  virtual bool open();
44 
47  virtual bool close();
48 
53  virtual void send(uint8_t ch);
54 
57  virtual bool canRead();
58 
61  virtual uint8_t read();
62 
63 private:
64  const char* _device; // ASCII device name
65  int _fd; // filedesc if open
66  bool _isOpen ; // true if device is open
67  struct termios _currentTermios; // Current terminal settings
68  struct termios _oldTermios; // Original terminal settings
69 };
70 
71 #endif
virtual uint8_t read()
Definition: UnixPort.cpp:139
virtual void send(uint8_t ch)
Definition: UnixPort.cpp:123
virtual bool open()
Definition: UnixPort.cpp:82
Abstract superclass for accessing RS232 port on the host.
Definition: Port.h:23
virtual bool canRead()
Definition: UnixPort.cpp:130
Map27UnixPort()
Definition: UnixPort.cpp:17
void setDevice(const char *device)
Definition: UnixPort.cpp:24
const char * device()
Definition: UnixPort.cpp:29
Access RS232 port on Unix/Linux.
Definition: UnixPort.h:24
virtual bool close()
Definition: UnixPort.cpp:112