qserialiodevice_p.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /****************************************************************************
  2. **
  3. ** This file is part of the Qt Extended Opensource Package.
  4. **
  5. ** Copyright (C) 2009 Trolltech ASA.
  6. **
  7. ** Contact: Qt Extended Information (info@qtextended.org)
  8. **
  9. ** This file may be used under the terms of the GNU General Public License
  10. ** version 2.0 as published by the Free Software Foundation and appearing
  11. ** in the file LICENSE.GPL included in the packaging of this file.
  12. **
  13. ** Please review the following information to ensure GNU General Public
  14. ** Licensing requirements will be met:
  15. ** http://www.fsf.org/licensing/licenses/info/GPLv2.html.
  16. **
  17. **
  18. ****************************************************************************/
  19. #ifndef QSERIALIODEVICE_P_H
  20. #define QSERIALIODEVICE_P_H
  21. //
  22. // W A R N I N G
  23. // -------------
  24. //
  25. // This file is not part of the Qt Extended API. It exists purely as an
  26. // implementation detail. This header file may change from version to
  27. // version without notice, or even be removed.
  28. //
  29. // We mean it.
  30. //
  31. #include <qobject.h>
  32. #include <qprocess.h>
  33. class QSerialIODevice;
  34. class QPseudoTtyProcess : public QProcess
  35. {
  36. Q_OBJECT
  37. public:
  38. QPseudoTtyProcess( QSerialIODevice *device, int masterFd,
  39. int slaveFd, bool isPPP );
  40. ~QPseudoTtyProcess();
  41. void clearDevice() { device = 0; }
  42. void deviceReadyRead();
  43. protected:
  44. void setupChildProcess();
  45. private slots:
  46. void masterReadyRead();
  47. void childStateChanged( QProcess::ProcessState state );
  48. void deviceReady();
  49. private:
  50. QSerialIODevice *device;
  51. int masterFd;
  52. int slaveFd;
  53. bool isPPP;
  54. bool readySeen;
  55. char buffer[1024];
  56. };
  57. #endif