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