summaryrefslogtreecommitdiffstats
path: root/tools/runonphone/symbianutils/communicationstarter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/runonphone/symbianutils/communicationstarter.cpp')
-rw-r--r--tools/runonphone/symbianutils/communicationstarter.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/tools/runonphone/symbianutils/communicationstarter.cpp b/tools/runonphone/symbianutils/communicationstarter.cpp
index e5e556e..cdee49f 100644
--- a/tools/runonphone/symbianutils/communicationstarter.cpp
+++ b/tools/runonphone/symbianutils/communicationstarter.cpp
@@ -58,7 +58,6 @@ struct BaseCommunicationStarterPrivate {
int intervalMS;
int attempts;
int n;
- QString device;
QString errorString;
BaseCommunicationStarter::State state;
};
@@ -70,7 +69,6 @@ BaseCommunicationStarterPrivate::BaseCommunicationStarterPrivate(const BaseCommu
intervalMS(1000),
attempts(-1),
n(0),
- device(QLatin1String("/dev/rfcomm0")),
state(BaseCommunicationStarter::TimedOut)
{
}
@@ -108,7 +106,7 @@ BaseCommunicationStarter::StartResult BaseCommunicationStarter::start()
// Before we instantiate timers, and such, try to open the device,
// which should succeed if another listener is already running in
// 'Watch' mode
- if (d->trkDevice->open(d->device , &(d->errorString)))
+ if (d->trkDevice->open(&(d->errorString)))
return ConnectionSucceeded;
// Pull up resources for next attempt
d->n = 0;
@@ -155,12 +153,7 @@ void BaseCommunicationStarter::setAttempts(int a)
QString BaseCommunicationStarter::device() const
{
- return d->device;
-}
-
-void BaseCommunicationStarter::setDevice(const QString &dv)
-{
- d->device = dv;
+ return d->trkDevice->port();
}
QString BaseCommunicationStarter::errorString() const
@@ -175,20 +168,20 @@ void BaseCommunicationStarter::slotTimer()
if (d->attempts >= 0 && d->n >= d->attempts) {
stopTimer();
d->errorString = tr("%1: timed out after %n attempts using an interval of %2ms.", 0, d->n)
- .arg(d->device).arg(d->intervalMS);
+ .arg(d->trkDevice->port()).arg(d->intervalMS);
d->state = TimedOut;
emit timeout();
} else {
// Attempt n to connect?
- if (d->trkDevice->open(d->device , &(d->errorString))) {
+ if (d->trkDevice->open(&(d->errorString))) {
stopTimer();
- const QString msg = tr("%1: Connection attempt %2 succeeded.").arg(d->device).arg(d->n);
+ const QString msg = tr("%1: Connection attempt %2 succeeded.").arg(d->trkDevice->port()).arg(d->n);
emit message(msg);
d->state = Connected;
emit connected();
} else {
const QString msg = tr("%1: Connection attempt %2 failed: %3 (retrying)...")
- .arg(d->device).arg(d->n).arg(d->errorString);
+ .arg(d->trkDevice->port()).arg(d->n).arg(d->errorString);
emit message(msg);
}
}
@@ -228,13 +221,11 @@ BluetoothListener *ConsoleBluetoothStarter::createListener()
bool ConsoleBluetoothStarter::startBluetooth(const TrkDevicePtr &trkDevice,
QObject *listenerParent,
- const QString &device,
int attempts,
QString *errorMessage)
{
// Set up a console starter to print to stdout.
ConsoleBluetoothStarter starter(trkDevice, listenerParent);
- starter.setDevice(device);
starter.setAttempts(attempts);
switch (starter.start()) {
case Started: