summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/io_bt.cpp
authorharlekin <harlekin>2002-10-12 15:44:01 (UTC)
committer harlekin <harlekin>2002-10-12 15:44:01 (UTC)
commite6b92ad451dba66f4eb5000a41b96eb2ee203dce (patch) (side-by-side diff)
tree07caa3f11d59c96858dd374d6b7cff90dbe3915e /noncore/apps/opie-console/io_bt.cpp
parent83aed438ec060307bf5562d91bd8b61fe60f860b (diff)
downloadopie-e6b92ad451dba66f4eb5000a41b96eb2ee203dce.zip
opie-e6b92ad451dba66f4eb5000a41b96eb2ee203dce.tar.gz
opie-e6b92ad451dba66f4eb5000a41b96eb2ee203dce.tar.bz2
some more stuff - modem config, bluetooth.. -, not finished
Diffstat (limited to 'noncore/apps/opie-console/io_bt.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_bt.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp
new file mode 100644
index 0000000..8bff4df
--- a/dev/null
+++ b/noncore/apps/opie-console/io_bt.cpp
@@ -0,0 +1,63 @@
+
+#include "io_bt.h"
+
+IOBt::IOBt( const Profile &config ) : IOSerial( config ) {
+ m_attach = 0;
+}
+
+
+IOBt::~IOBt() {
+ if ( m_attach ) {
+ delete m_attach;
+ }
+}
+
+
+void IOBt::close() {
+
+ IOSerial::close();
+ // still need error handling
+ delete m_attach;
+}
+
+bool IOBt::open() {
+
+ // hciattach here
+ m_attach = new OProcess();
+ *m_attach << "hciattach /dev/ttyS2 any 57600";
+
+ // then start hcid, then rcfomm handling (m_mac)
+
+ connect( m_attach, SIGNAL( processExited( OProcess* ) ),
+ this, SLOT( slotExited( OProcess* ) ) );
+
+ if ( m_attach->start() ) {
+ IOSerial::open();
+ } else {
+ qWarning("could not attach to device");
+ delete m_attach;
+ }
+}
+
+void IOBt::reload( const Profile &config ) {
+ m_device = config.readEntry("Device", BT_DEFAULT_DEVICE);
+ m_mac = config.readEntry("Mac", BT_DEFAULT_MAC);
+ m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD);
+ m_parity = config.readNumEntry("Parity", BT_DEFAULT_PARITY);
+ m_dbits = config.readNumEntry("DataBits", BT_DEFAULT_DBITS);
+ m_sbits = config.readNumEntry("StopBits", BT_DEFAULT_SBITS);
+ m_flow = config.readNumEntry("Flow", BT_DEFAULT_FLOW);
+}
+
+
+QString IOBt::identifier() const {
+ return "bluetooth";
+}
+
+QString IOBt::name() const {
+ return "BLuetooth IO Layer";
+}
+
+void IOBt::slotExited( OProcess* proc ){
+ close();
+}