cec: serial port locking on linux
[deb_libcec.git] / src / lib / platform / sockets / serialport.h
index bdd05b96f3edc0ebf1ab9946a4f69f200c9cd3e7..a16e3ca72115a77279de9837bb8311f0ba025115 100644 (file)
@@ -71,6 +71,11 @@ namespace PLATFORM
     public:
       CSerialSocket(const CStdString &strName, uint32_t iBaudrate, SerialDataBits iDatabits = SERIAL_DATA_BITS_EIGHT, SerialStopBits iStopbits = SERIAL_STOP_BITS_ONE, SerialParity iParity = SERIAL_PARITY_NONE) :
           CCommonSocket<serial_socket_t>(INVALID_SERIAL_SOCKET_VALUE, strName),
+          #ifdef __WINDOWS__
+          m_iCurrentReadTimeout(MAXDWORD),
+          #else
+          m_lockPid(0),
+          #endif
           m_bIsOpen(false),
           m_iBaudrate(iBaudrate),
           m_iDatabits(iDatabits),
@@ -96,6 +101,10 @@ namespace PLATFORM
     protected:
   #ifndef __WINDOWS__
       struct termios  m_options;
+      pid_t           m_lockPid;
+  #else
+      bool SetTimeouts(serial_socket_t socket, int* iError, DWORD iTimeoutMs);
+      DWORD           m_iCurrentReadTimeout;
   #endif
 
       bool            m_bIsOpen;