summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/io_bt.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/io_bt.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_bt.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp
index 0831faf..d71aacc 100644
--- a/noncore/apps/opie-console/io_bt.cpp
+++ b/noncore/apps/opie-console/io_bt.cpp
@@ -17,11 +17,19 @@ void IOBt::close() {
IOSerial::close();
// still need error handling
+ if ( m_attach ) {
delete m_attach;
+ m_attach = 0;
+ }
}
bool IOBt::open() {
+ // only set up bt stuff if mac address was set, otherwise use the device set
+ if ( !m_mac.isEmpty() ) {
+
+ // now it should also be checked, if there is a connection to the device with that mac allready
+
// hciattach here
m_attach = new OProcess();
*m_attach << "hciattach /dev/ttyS2 any 57600";
@@ -38,6 +46,12 @@ bool IOBt::open() {
delete m_attach;
m_attach = 0;
}
+ } else {
+ // directly to the normal serial
+ // TODO: look first if the connection really exists. ( is set up )
+
+ IOSerial::open();
+ }
}
void IOBt::reload( const Profile &config ) {