From 078958f502b737679f1936fe687b75daaffaa2c0 Mon Sep 17 00:00:00 2001 From: Oliver Ruiz Dorantes Date: Tue, 15 Apr 2008 22:31:54 +0000 Subject: [PATCH] - Run the Looper - Create Agent from the LocalDevice - Fix constructors git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24977 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/bluetooth/DiscoveryAgent.cpp | 12 +++++------- src/kits/bluetooth/DiscoveryListener.cpp | 13 ++++++------- src/kits/bluetooth/LocalDevice.cpp | 4 ++-- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/kits/bluetooth/DiscoveryAgent.cpp b/src/kits/bluetooth/DiscoveryAgent.cpp index deb1e17d26..ad2d70fa5c 100644 --- a/src/kits/bluetooth/DiscoveryAgent.cpp +++ b/src/kits/bluetooth/DiscoveryAgent.cpp @@ -9,15 +9,13 @@ #include #include #include - #include - -#include -#include - #include #include +#include +#include + #include "KitSupport.h" @@ -128,9 +126,9 @@ DiscoveryAgent::SetLocalDeviceOwner(LocalDevice* ld) fLocalDevice = ld; } -DiscoveryAgent::DiscoveryAgent() +DiscoveryAgent::DiscoveryAgent(LocalDevice* ld) { - fLocalDevice = NULL; + fLocalDevice = ld; } diff --git a/src/kits/bluetooth/DiscoveryListener.cpp b/src/kits/bluetooth/DiscoveryListener.cpp index f9f836630c..3b50eb6143 100644 --- a/src/kits/bluetooth/DiscoveryListener.cpp +++ b/src/kits/bluetooth/DiscoveryListener.cpp @@ -21,24 +21,22 @@ namespace Bluetooth { /* hooks */ void DiscoveryListener::DeviceDiscovered(RemoteDevice* btDevice, DeviceClass cod) -{ - - +{ + } void DiscoveryListener::InquiryStarted(status_t status) { - -} +} void DiscoveryListener::InquiryCompleted(int discType) { - + } @@ -120,7 +118,8 @@ DiscoveryListener::MessageReceived(BMessage* message) DiscoveryListener::DiscoveryListener() : BLooper() { - + // TODO: Make a better handling of the running not running state + Run(); } diff --git a/src/kits/bluetooth/LocalDevice.cpp b/src/kits/bluetooth/LocalDevice.cpp index 0fbef4fdcb..eb97ea1735 100644 --- a/src/kits/bluetooth/LocalDevice.cpp +++ b/src/kits/bluetooth/LocalDevice.cpp @@ -113,8 +113,8 @@ LocalDevice::GetLocalDeviceCount() DiscoveryAgent* LocalDevice::GetDiscoveryAgent() { - - return NULL; + /* TODO: Study a singleton here */ + return new DiscoveryAgent(this); }