summaryrefslogtreecommitdiff
authoraquadran <aquadran>2006-01-08 12:35:44 (UTC)
committer aquadran <aquadran>2006-01-08 12:35:44 (UTC)
commit2664267708d5ed695151bf0ec9376080e7bf617e (patch) (side-by-side diff)
treea3f7b8b7164478d70e70258363e828f8bedfb341
parentd795d596af30d2856544b960d37e779659c324a6 (diff)
downloadopie-2664267708d5ed695151bf0ec9376080e7bf617e.zip
opie-2664267708d5ed695151bf0ec9376080e7bf617e.tar.gz
opie-2664267708d5ed695151bf0ec9376080e7bf617e.tar.bz2
added support for asus mypal 716 in bluepingplugin
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/securityplugins/blueping/bluepingplugin.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/securityplugins/blueping/bluepingplugin.cpp b/noncore/securityplugins/blueping/bluepingplugin.cpp
index 1c514e5..05c26ba 100644
--- a/noncore/securityplugins/blueping/bluepingplugin.cpp
+++ b/noncore/securityplugins/blueping/bluepingplugin.cpp
@@ -134,92 +134,96 @@ int BluepingPlugin::authenticate() {
QRect desk = oApp->desktop()->geometry();
bluepingDialog.setGeometry( 0, 0, desk.width(), desk.height() );
// Creation of the particular widgets of our Blueping user interface
QVBoxLayout *layout = new QVBoxLayout(&bluepingDialog);
layout->setSpacing(11);
layout->setMargin(11);
layout->setAlignment( Qt::AlignTop );
QLabel title("<center><h1>\"Blueping\" <br />plugin</h1></center>", &bluepingDialog);
QLabel subTitle("<center><h2>Trying to reach your configured bluetooth device...</h2></center>", &bluepingDialog);
QLabel subTitle2("<center>You can skip this step and use another authentication way with the following button</center>", &bluepingDialog);
QPushButton pbSkip("Skip", &bluepingDialog);
layout->addWidget(&title);
layout->addWidget(&subTitle);
layout->addWidget(&subTitle2);
layout->addWidget(&pbSkip, 0, Qt::AlignHCenter);
// connect the skip button to the skip signal emitting function
QObject::connect(&pbSkip, SIGNAL(clicked()), this, SLOT(skip()));
// connect the signal emitting functions to the bluepingDialog done(int) finishing function
QObject::connect(this, SIGNAL(emitCode(int)), &bluepingDialog, SLOT(done(int)));
/* let's start Bluetooth if it's not running
*/
OProcess checkB;
checkB << "pidof" << "hciattach";
odebug << "checking if Bluetooth is running..." << oendl;
// now we start bluetooth *only* if the previous command works, exits normally, and
// it returns a non-null exit code (which means hciattach is not running)
if ( checkB.start(OProcess::Block) && checkB.normalExit() && (checkB.exitStatus() != 0) )
{
// remember to switch off Bluetooth once we're finished...
bluetoothWasOff = true;
odebug << "Bluetooth is not running, we must start it now" << oendl;
OProcess startB;
switch ( ODevice::inst()->model() ) {
case Model_iPAQ_H39xx:
startB << "/sbin/hciattach" << "/dev/tts/1" << "bcsp" << "921600";
break;
case Model_iPAQ_H5xxx:
startB << "/sbin/hciattach" << "/dev/tts/1" << "any" << "921600";
break;
+ case Model_MyPal_716:
+ startB << "/sbin/hciattach" << "/dev/ttyS1" << "bcsp" << "921600";
+ break;
+
default:
startB << "/sbin/hciattach" << "/dev/ttySB0" << "bcsp" << "230400";
break;
} // end switch on device models
if ( !startB.start(OProcess::Block) ) {
oerr << "could not start Bluetooth" << oendl;
return MultiauthPluginObject::Skip;
}
else
{
if ( (startB.normalExit()) && (startB.exitStatus() == 0) )
{
odebug << "hciattach exited normally, Bluetooth is probably on now, let's wait 500 ms and ping" << oendl;
// 500 ms timer, so l2ping won't try to find a route before bluetooth has \em really started
QTimer::singleShot( 500, this, SLOT(ping()) );
}
else
{
owarn << "hciattach exited anormally (normalExit: " << startB.normalExit() << ", exit status: " << startB.exitStatus() << ")" << oendl;
return MultiauthPluginObject::Skip;
} // end if startB exited normaly
} // end if startBluetooth started
}
else
{
// we don't need to wait, since bluetooth has been started long enough ago
odebug << "Bluetooth is already running, we can try to ping now" << oendl;
ping();
} // end if Bluetooth was off
// start the dialog event loop, while the ping is starting (or will start soon) in the background
return bluepingDialog.exec();
}
else
{
owarn << "No Bluetooth device has been set!" << oendl;
owarn << "We will consider it as a successful authentication though." << oendl;
return MultiauthPluginObject::Success;
} // end if mac defined
}