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); }