summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib/device.cc
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/lib/device.cc') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/device.cc55
1 files changed, 30 insertions, 25 deletions
diff --git a/noncore/net/opietooth/lib/device.cc b/noncore/net/opietooth/lib/device.cc
index 04c50d9..f81066e 100644
--- a/noncore/net/opietooth/lib/device.cc
+++ b/noncore/net/opietooth/lib/device.cc
@@ -1,7 +1,12 @@
-#include <signal.h>
+#include "device.h"
+/* OPIE */
#include <opie2/oprocess.h>
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* STD */
+#include <signal.h>
-#include "device.h"
@@ -16,3 +21,3 @@ namespace {
for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){
- qWarning("parsePID: %s", (*it).latin1() );
+ owarn << "parsePID: " << (*it).latin1() << oendl;
if( !(*it).startsWith("CSR") ){
@@ -29,3 +34,3 @@ Device::Device(const QString &device, const QString &mode, const QString &speed
- qWarning("OpieTooth::Device create" );
+ owarn << "OpieTooth::Device create" << oendl;
m_hci = 0;
@@ -42,6 +47,6 @@ Device::~Device(){
void Device::attach(){
- qWarning("attaching %s %s %s", m_device.latin1(), m_mode.latin1(), m_speed.latin1() );
+ owarn << "attaching " << m_device.latin1() << " " << m_mode.latin1() << " " << m_speed.latin1() << oendl;
if(m_process == 0 ){
m_output.resize(0);
- qWarning("new process to create" );
+ owarn << "new process to create" << oendl;
m_process = new OProcess();
@@ -57,3 +62,3 @@ void Device::attach(){
if(!m_process->start(OProcess::NotifyOnExit, OProcess::AllOutput ) ){
- qWarning("Could not start" );
+ owarn << "Could not start" << oendl;
delete m_process;
@@ -69,6 +74,6 @@ void Device::detach(){
//kill the pid
- qWarning( "killing" );
+ warn << "killing" << oendl;
kill(pid, 9);
}
- qWarning("detached" );
+ owarn << "detached" << oendl;
}
@@ -82,13 +87,13 @@ void Device::slotExited( OProcess* proc)
{
- qWarning("prcess exited" );
+ owarn << "prcess exited" << oendl;
if(proc== m_process ){
- qWarning("proc == m_process" );
+ owarn << "proc == m_process" << oendl;
if( m_process->normalExit() ){ // normal exit
- qWarning("normalExit" );
+ owarn << "normalExit" << oendl;
int ret = m_process->exitStatus();
if( ret == 0 ){ // attached
- qWarning("attached" );
- qWarning("Output: %s", m_output.data() );
+ owarn << "attached" << oendl;
+ owarn << "Output: " << m_output.data() << oendl;
pid = parsePid( m_output );
- qWarning("Pid = %d", pid );
+ owarn << "Pid = " << pid << oendl;
// now hciconfig hci0 up ( determine hciX FIXME)
@@ -102,3 +107,3 @@ void Device::slotExited( OProcess* proc)
if(!m_hci->start() ){
- qWarning("could not start" );
+ owarn << "could not start" << oendl;
m_attached = false;
@@ -107,3 +112,3 @@ void Device::slotExited( OProcess* proc)
}else{
- qWarning("crass" );
+ owarn << "crass" << oendl;
m_attached = false;
@@ -116,8 +121,8 @@ void Device::slotExited( OProcess* proc)
}else if(proc== m_hci ){
- qWarning("M HCI exited" );
+ owarn << "M HCI exited" << oendl;
if( m_hci->normalExit() ){
- qWarning("normal exit" );
+ owarn << "normal exit" << oendl;
int ret = m_hci->exitStatus();
if( ret == 0 ){
- qWarning("attached really really attached" );
+ owarn << "attached really really attached" << oendl;
m_attached = true;
@@ -125,3 +130,3 @@ void Device::slotExited( OProcess* proc)
}else{
- qWarning( "failed" );
+ owarn << "failed" << oendl;
emit device("hci0", false );
@@ -136,5 +141,5 @@ void Device::slotStdOut(OProcess* proc, char* chars, int len)
{
- qWarning("std out" );
+ owarn << "std out" << oendl;
if( len <1 ){
- qWarning( "len < 1 " );
+ owarn << "len < 1 " << oendl;
return;
@@ -143,3 +148,3 @@ void Device::slotStdOut(OProcess* proc, char* chars, int len)
QCString string( chars, len+1 ); // \0 == +1
- qWarning("output: %s", string.data() );
+ owarn << "output: " << string.data() << oendl;
m_output.append( string.data() );
@@ -149,3 +154,3 @@ void Device::slotStdErr(OProcess* proc, char* chars, int len)
{
- qWarning("std err" );
+ owarn << "std err" << oendl;
slotStdOut( proc, chars, len );