summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp
index e1c2341..5676e4f 100644
--- a/noncore/net/opietooth/applet/bluezapplet.cpp
+++ b/noncore/net/opietooth/applet/bluezapplet.cpp
@@ -67,96 +67,100 @@ namespace OpieTooth {
bluezactive = false;
bluezDiscoveryActive = false;
// TODO: determine whether this channel has to be closed at destruction time.
QCopChannel* chan = new QCopChannel("QPE/Bluetooth", this );
connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ),
this, SLOT(slotMessage(const QCString&,const QByteArray&) ) );
}
BluezApplet::~BluezApplet() {
if ( btDevice ) {
delete btDevice;
}
if ( btManager ) {
delete btManager;
}
}
int BluezApplet::position()
{
return 6;
}
bool BluezApplet::checkBluezStatus() {
if (btDevice) {
if (btDevice->isLoaded() ) {
return true;
} else {
return false;
}
} else {
return false;
}
}
int BluezApplet::setBluezStatus(int c) {
if ( c == 1 ) {
switch ( ODevice::inst()->model() ) {
case Model_iPAQ_H39xx:
btDevice = new Device( "/dev/tts/1", "bcsp", "921600" );
break;
case Model_iPAQ_H5xxx:
btDevice = new Device( "/dev/tts/1", "any", "921600" );
break;
+ case Model_MyPal_716:
+ btDevice = new Device( "/dev/ttyS1", "bcsp", "921600" );
+ break;
+
default:
btDevice = new Device( "/dev/ttySB0", "bcsp", "230400" );
break;
}
} else {
if ( btDevice ) {
delete btDevice;
btDevice = 0;
}
}
return 0;
}
int BluezApplet::checkBluezDiscoveryStatus() {
return bluezDiscoveryActive;
}
int BluezApplet::setBluezDiscoveryStatus(int d) {
return bluezDiscoveryActive=d;
}
// FIXME mbhaynie
// receiver for QCopChannel("QPE/Bluetooth") messages.
void BluezApplet::slotMessage( const QCString& str, const QByteArray& )
{
if ( str == "enableBluetooth()") {
if (!checkBluezStatus()) {
setBluezStatus(1);
}
} else if ( str == "disableBluetooth()") {
if (checkBluezStatus()) {
// setBluezStatus(0);
}
} else if ( str == "listDevices()") {
if (!btManager)
{
btManager = new Manager("hci0");
connect( btManager, SIGNAL( foundDevices(const QString&,RemoteDevice::ValueList) ),
this, SLOT( fillList(const QString&,RemoteDevice::ValueList) ) ) ;
}
btManager->searchDevices();
}
}
// Once the hcitool scan is complete, report back.
void BluezApplet::fillList(const QString&, RemoteDevice::ValueList deviceList)
{