DR-U-USB/DR-E-USB RLMXX0CLASS  GT20171121-1
bsp_serial.h
Go to the documentation of this file.
1 
14 #ifndef _SERIALFUNC_
15 #define _SERIALFUNC_
16 
17 #include <QObject>
18 #include <QByteArray>
19 #include <sys/epoll.h>
20 #include <sys/types.h>
21 
40 class BSP_Serial : public QObject
41 {
42 Q_OBJECT
43  public:
44  BSP_Serial();
45  ~BSP_Serial();
46  void init_Serial(const char* port, qint32 speed, qint32 flow, qint32 dir = 0);
47  void close_Serial(void);
48  qint32 BSP_Ser_WrByte(const QByteArray& wb);
49  quint8 BSP_Ser_RdByte(quint8* status);
50  quint8 BSP_Ser_RSelect(quint32 t);
51  qint32 BSP_Ser_ByteAvailable();
52  bool isopen(void);
53  void clearbuffers(quint8 direction);
54  qint32 getFd( ) { return _fd; }
55 
56  signals:
57  void siglostconnection();
58 
59  private:
60  qint32 _fd;
61  int _epfd;
62  struct epoll_event _ev;
63 };
64 
65 #endif
Class library for serial communication.
Definition: bsp_serial.h:40