-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/device.cc | 11 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/lib.pro | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp index a380ac7..6e5ee82 100644 --- a/noncore/net/opietooth/applet/bluezapplet.cpp +++ b/noncore/net/opietooth/applet/bluezapplet.cpp | |||
@@ -75,9 +75,9 @@ namespace OpieTooth { | |||
75 | 75 | ||
76 | int BluezApplet::setBluezStatus(int c) { | 76 | int BluezApplet::setBluezStatus(int c) { |
77 | 77 | ||
78 | if (c == 1) { | 78 | if (c == 1) { |
79 | btDevice = new Device("/dev/ttySB0", "scr" ); | 79 | btDevice = new Device("/dev/ttySB0", "csr" ); |
80 | // system("hciattach /dev/ttySB0 csr"); | 80 | // system("hciattach /dev/ttySB0 csr"); |
81 | //system("hcid"); | 81 | //system("hcid"); |
82 | } else { | 82 | } else { |
83 | if (btDevice) { | 83 | if (btDevice) { |
diff --git a/noncore/net/opietooth/lib/device.cc b/noncore/net/opietooth/lib/device.cc index 5234996..5edfc03 100644 --- a/noncore/net/opietooth/lib/device.cc +++ b/noncore/net/opietooth/lib/device.cc | |||
@@ -12,8 +12,9 @@ namespace { | |||
12 | int id=0; | 12 | int id=0; |
13 | QString string( par ); | 13 | QString string( par ); |
14 | QStringList list = QStringList::split( '\n', string ); | 14 | QStringList list = QStringList::split( '\n', string ); |
15 | for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){ | 15 | for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){ |
16 | qWarning("parsePID: %s", (*it).latin1() ); | ||
16 | if( !(*it).startsWith("CSR") ){ | 17 | if( !(*it).startsWith("CSR") ){ |
17 | id = (*it).toInt(); | 18 | id = (*it).toInt(); |
18 | break; | 19 | break; |
19 | } | 20 | } |
@@ -77,9 +78,11 @@ QString Device::devName()const { | |||
77 | void Device::slotExited( OProcess* proc) | 78 | void Device::slotExited( OProcess* proc) |
78 | { | 79 | { |
79 | qWarning("prcess exited" ); | 80 | qWarning("prcess exited" ); |
80 | if(proc== m_process ){ | 81 | if(proc== m_process ){ |
82 | qWarning("proc == m_process" ); | ||
81 | if( m_process->normalExit() ){ // normal exit | 83 | if( m_process->normalExit() ){ // normal exit |
84 | qWarning("normalExit" ); | ||
82 | int ret = m_process->exitStatus(); | 85 | int ret = m_process->exitStatus(); |
83 | if( ret == 0 ){ // attached | 86 | if( ret == 0 ){ // attached |
84 | qWarning("attached" ); | 87 | qWarning("attached" ); |
85 | qWarning("Output: %s", m_output.data() ); | 88 | qWarning("Output: %s", m_output.data() ); |
@@ -98,8 +101,9 @@ void Device::slotExited( OProcess* proc) | |||
98 | m_attached = false; | 101 | m_attached = false; |
99 | emit device("hci0", false ); | 102 | emit device("hci0", false ); |
100 | } | 103 | } |
101 | }else{ | 104 | }else{ |
105 | qWarning("crass" ); | ||
102 | m_attached = false; | 106 | m_attached = false; |
103 | emit device("hci0", false ); | 107 | emit device("hci0", false ); |
104 | 108 | ||
105 | } | 109 | } |
@@ -127,16 +131,19 @@ void Device::slotExited( OProcess* proc) | |||
127 | } | 131 | } |
128 | void Device::slotStdOut(OProcess* proc, char* chars, int len) | 132 | void Device::slotStdOut(OProcess* proc, char* chars, int len) |
129 | { | 133 | { |
130 | qWarning("std out" ); | 134 | qWarning("std out" ); |
131 | if( len <1 ) | 135 | if( len <1 ){ |
136 | qWarning( "len < 1 " ); | ||
132 | return; | 137 | return; |
138 | } | ||
133 | if(proc == m_process ){ | 139 | if(proc == m_process ){ |
134 | QCString string( chars, len+1 ); // \0 == +1 | 140 | QCString string( chars, len+1 ); // \0 == +1 |
135 | qWarning("output: %s", string.data() ); | 141 | qWarning("output: %s", string.data() ); |
136 | m_output.append( string.data() ); | 142 | m_output.append( string.data() ); |
137 | } | 143 | } |
138 | } | 144 | } |
139 | void Device::slotStdErr(OProcess*, char*, int ) | 145 | void Device::slotStdErr(OProcess* proc, char* chars, int len) |
140 | { | 146 | { |
141 | qWarning("std err" ); | 147 | qWarning("std err" ); |
148 | slotStdOut( proc, chars, len ); | ||
142 | } | 149 | } |
diff --git a/noncore/net/opietooth/lib/lib.pro b/noncore/net/opietooth/lib/lib.pro index f2cde06..ce36d66 100644 --- a/noncore/net/opietooth/lib/lib.pro +++ b/noncore/net/opietooth/lib/lib.pro | |||
@@ -4,6 +4,6 @@ HEADERS = device.h manager.h remotedevice.h services.h | |||
4 | SOURCES = device.cc manager.cc remotedevice.cc services.cc | 4 | SOURCES = device.cc manager.cc remotedevice.cc services.cc |
5 | TARGET = opietooth | 5 | TARGET = opietooth |
6 | INCLUDEPATH += $(OPIEDIR)/include | 6 | INCLUDEPATH += $(OPIEDIR)/include |
7 | DESTDIR = $(QTDIR)/lib$(PROJMAK) | 7 | DESTDIR = $(QTDIR)/lib$(PROJMAK) |
8 | LIBS = -lopie | 8 | LIBS += -lopie |
9 | #VERSION = 0.0.0 | 9 | #VERSION = 0.0.0 |