summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib/manager.cc
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/lib/manager.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/manager.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc
index 40c1f0a..c454588 100644
--- a/noncore/net/opietooth/lib/manager.cc
+++ b/noncore/net/opietooth/lib/manager.cc
@@ -53,25 +53,25 @@ void Manager::isConnected( Device* dev ){
}
void Manager::searchDevices( const QString& device ){
qWarning("search devices");
OProcess* hcitool = new OProcess();
hcitool->setName( device.isEmpty() ? "hci0" : device.latin1() );
*hcitool << "hcitool" << "scan";
connect( hcitool, SIGNAL(processExited(OProcess*) ) ,
this, SLOT(slotHCIExited(OProcess* ) ) );
connect( hcitool, SIGNAL(receivedStdout(OProcess*, char*, int ) ),
this, SLOT(slotHCIOut(OProcess*, char*, int ) ) );
if (!hcitool->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
qWarning("could not start");
- RemoteDevices::ValueList list;
+ RemoteDevice::ValueList list;
emit foundDevices( device, list );
delete hcitool;
}
}
void Manager::searchDevices(Device* d ){
}
void Manager::addService(const QString& name ){
OProcess proc;
proc << "sdptool" << "add" << name;
@@ -103,25 +103,25 @@ void Manager::searchServices( const QString& remDevice ){
*m_sdp << "sdptool" << "browse" << remDevice;
m_sdp->setName( remDevice.latin1() );
connect(m_sdp, SIGNAL(processExited(OProcess*) ),
this, SLOT(slotSDPExited(OProcess* ) ) );
connect(m_sdp, SIGNAL(receivedStdout(OProcess*, char*, int ) ),
this, SLOT(slotSDPOut(OProcess*, char*, int) ) );
if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
delete m_sdp;
Services::ValueList list;
emit foundServices( remDevice, list );
}
}
-void Manager::searchServices( const RemoteDevices& dev){
+void Manager::searchServices( const RemoteDevice& dev){
searchServices( dev.mac() );
}
QString Manager::toDevice( const QString& mac ){
}
QString Manager::toMac( const QString &device ){
}
void Manager::slotProcessExited(OProcess* proc ) {
bool conn= false;
if (proc->normalExit() && proc->exitStatus() == 0 )
conn = true;
@@ -153,25 +153,25 @@ void Manager::slotSDPExited( OProcess* proc)
}
}
emit foundServices( proc->name(), list );
delete proc;
}
Services::ValueList Manager::parseSDPOutput( const QString& out ) {
Services::ValueList list;
return list;
}
void Manager::slotHCIExited(OProcess* proc ) {
qWarning("process exited");
- RemoteDevices::ValueList list;
+ RemoteDevice::ValueList list;
if (proc->normalExit() ) {
qWarning("normalExit %s", proc->name() );
QMap<QString, QString>::Iterator it = m_devices.find(proc->name() );
if (it != m_devices.end() ) {
qWarning("!= end ;)");
list = parseHCIOutput( it.data() );
m_devices.remove( it );
}
}
emit foundDevices( proc->name(), list );
delete proc;
}
@@ -181,33 +181,33 @@ void Manager::slotHCIOut(OProcess* proc, char* ch, int len) {
QMap<QString, QString>::Iterator it;
it = m_devices.find( proc->name() );
qWarning("proc->name %s", proc->name() );
QString string;
if (it != m_devices.end() ) {
qWarning("slotHCIOut ");
string = it.data();
}
string.append( str );
m_devices.replace( proc->name(), string );
}
-RemoteDevices::ValueList Manager::parseHCIOutput(const QString& output ) {
+RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) {
qWarning("parseHCI %s", output.latin1() );
- RemoteDevices::ValueList list;
+ RemoteDevice::ValueList list;
QStringList strList = QStringList::split('\n', output );
QStringList::Iterator it;
QString str;
for ( it = strList.begin(); it != strList.end(); ++it ) {
str = (*it).stripWhiteSpace();
qWarning("OpieTooth %s", str.latin1() );
int pos = str.findRev(':' );
if ( pos > 0 ) {
QString mac = str.left(17 );
str.remove( 0, 17 );
qWarning("mac %s", mac.latin1() );
qWarning("rest:%s", str.latin1() );
- RemoteDevices rem( mac , str.stripWhiteSpace() );
+ RemoteDevice rem( mac , str.stripWhiteSpace() );
list.append( rem );
}
}
return list;
}