From 74a52b95c2cbe09f1eff944350db54c50fd9f3f2 Mon Sep 17 00:00:00 2001 From: Oliver Ruiz Dorantes Date: Tue, 23 Oct 2007 17:25:38 +0000 Subject: [PATCH] -I bet for now is the last public class DiscoveryListener:BLooper\n-Fix RemoteDevice... friendship git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22679 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/bluetooth/DiscoveryListener.h | 57 ++++++++++++++++++++++++ headers/os/bluetooth/RemoteDevice.h | 3 ++ 2 files changed, 60 insertions(+) create mode 100644 headers/os/bluetooth/DiscoveryListener.h diff --git a/headers/os/bluetooth/DiscoveryListener.h b/headers/os/bluetooth/DiscoveryListener.h new file mode 100644 index 0000000000..537403788c --- /dev/null +++ b/headers/os/bluetooth/DiscoveryListener.h @@ -0,0 +1,57 @@ +/* + * Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com + * + * All rights reserved. Distributed under the terms of the MIT License. + * + */ + +#ifndef _DISCOVERY_LISTENER_H +#define _DISCOVERY_LISTENER_H + +#include + + +#define B_BT_INQUIRY_COMPLETED 0x01 // HCI_EVENT_X check specs +#define B_BT_INQUIRY_TERMINATED 0x02 // HCI_EVENT_X +#define B_BT_INQUIRY_ERROR 0x03 // HCI_EVENT_X + + +namespace Bluetooth { + +class RemoteDevice; +class DeviceClass; + + +class DiscoveryListener : BLooper { + + public: + + static const int INQUIRY_COMPLETED = B_BT_INQUIRY_COMPLETED; + static const int INQUIRY_TERMINATED = B_BT_INQUIRY_TERMINATED; + static const int INQUIRY_ERROR = B_BT_INQUIRY_ERROR; + + static const int SERVICE_SEARCH_COMPLETED = 0x01; + static const int SERVICE_SEARCH_TERMINATED = 0x02; + static const int SERVICE_SEARCH_ERROR = 0x03; + static const int SERVICE_SEARCH_NO_RECORDS = 0x04; + static const int SERVICE_SEARCH_DEVICE_NOT_REACHABLE = 0x06; + + virtual void DeviceDiscovered(RemoteDevice btDevice, DeviceClass cod); + /* + virtual void servicesDiscovered(int transID, ServiceRecord[] servRecord); + virtual void serviceSearchCompleted(int transID, int respCode); + */ + virtual void InquiryCompleted(int discType); + + private: + DiscoveryListener(); + void MessageReceived(BMessage* msg); + + + friend class RemoteDevice; + +}; + +} + +#endif diff --git a/headers/os/bluetooth/RemoteDevice.h b/headers/os/bluetooth/RemoteDevice.h index 65073d5a37..e89af98af9 100644 --- a/headers/os/bluetooth/RemoteDevice.h +++ b/headers/os/bluetooth/RemoteDevice.h @@ -42,6 +42,9 @@ class RemoteDevice { protected: RemoteDevice(BString address); + + /* Instances of this class only will be done by Discovery[Listener|Agent] TODO */ + friend class DiscoveryListener; };