summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib
authorkorovkin <korovkin>2006-05-14 15:38:20 (UTC)
committer korovkin <korovkin>2006-05-14 15:38:20 (UTC)
commit782a34192c2c879a80fd319153a2b2f48ded1c99 (patch) (side-by-side diff)
tree55f9d66e747876ffa2e87cf30eaafaf33864597a /noncore/net/opietooth/lib
parent273ffc42b3f0ce593e0d20874a7f224328416445 (diff)
downloadopie-782a34192c2c879a80fd319153a2b2f48ded1c99.zip
opie-782a34192c2c879a80fd319153a2b2f48ded1c99.tar.gz
opie-782a34192c2c879a80fd319153a2b2f48ded1c99.tar.bz2
Script must be started after device is started up.
We should wait for 1 second after device is brought up. Fixed an error in hcicongig hci0 up.
Diffstat (limited to 'noncore/net/opietooth/lib') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/device.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/net/opietooth/lib/device.cc b/noncore/net/opietooth/lib/device.cc
index 2f04d46..88d4cf9 100644
--- a/noncore/net/opietooth/lib/device.cc
+++ b/noncore/net/opietooth/lib/device.cc
@@ -117,49 +117,52 @@ void Device::slotExited( OProcess* proc)
owarn << "normalExit" << oendl;
int ret = m_process->exitStatus();
if( ret == 0 ){ // attached
owarn << "attached" << oendl;
owarn << "Output: " << m_output.data() << oendl;
pid = parsePid( m_output );
owarn << "Pid = " << pid << oendl;
// now hciconfig hci0 up ( determine hciX FIXME)
// and call hciconfig hci0 up
// FIXME hardcoded to hci0 now :(
m_hci = new OProcess( );
*m_hci << "hciconfig";
- *m_hci << "hci0 up";
+ *m_hci << "hci0";
+ *m_hci << "up";
connect(m_hci, SIGNAL( processExited(Opie::Core::OProcess*) ),
this, SLOT( slotExited(Opie::Core::OProcess* ) ) );
if(!m_hci->start() ){
owarn << "could not start" << oendl;
m_attached = false;
emit device("hci0", false );
}
}else{
owarn << "crass" << oendl;
m_attached = false;
emit device("hci0", false );
}
}
delete m_process;
m_process = 0;
}else if(proc== m_hci ){
owarn << "M HCI exited" << oendl;
if( m_hci->normalExit() ){
owarn << "normal exit" << oendl;
int ret = m_hci->exitStatus();
if( ret == 0 ){
owarn << "attached really really attached" << oendl;
m_attached = true;
+ //Wait for a device to be brought up
+ ::sleep(1);
emit device("hci0", true );
}else{
owarn << "failed" << oendl;
emit device("hci0", false );
m_attached = false;
}
}// normal exit
delete m_hci;
m_hci = 0;
}
}
void Device::slotStdOut(OProcess* proc, char* chars, int len)