00001 00002 #ifndef OPIETOOTH_RFCOMM_HELPER_H 00003 #define OPIETOOTH_RFCOMM_HELPER_H 00004 00005 #include <sys/types.h> 00006 00007 #include <qcstring.h> 00008 #include <qstring.h> 00009 00010 namespace OpieTooth { 00020 class RfCommHelper { 00021 public: 00025 RfCommHelper(); 00026 00030 ~RfCommHelper(); // kills the process 00031 00035 QCString attachedDevice() const; 00036 00041 void detach(); 00042 00048 bool attach(const QString& bd_addr, int port ); 00049 00054 void regroup(); 00055 private: 00056 bool connect( int dev, const QString& bdaddr, int port ); 00057 static void signal_handler(int); 00058 void setupComChild(); 00059 bool m_connected:1; 00060 static pid_t m_pid; 00061 QCString m_device; 00062 int m_fd[2]; 00063 int m_in2out[2]; 00064 int m_out2in[2]; 00065 static bool terminate ; 00066 }; 00067 }; 00068 00069 #endif
1.4.2