1 /* 2 * Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com 3 * 4 * All rights reserved. Distributed under the terms of the MIT License. 5 * 6 */ 7 8 #ifndef _DISCOVERY_LISTENER_H 9 #define _DISCOVERY_LISTENER_H 10 11 #include <Looper.h> 12 13 14 #define B_BT_INQUIRY_COMPLETED 0x01 // HCI_EVENT_X check specs 15 #define B_BT_INQUIRY_TERMINATED 0x02 // HCI_EVENT_X 16 #define B_BT_INQUIRY_ERROR 0x03 // HCI_EVENT_X 17 18 19 namespace Bluetooth { 20 21 class RemoteDevice; 22 class DeviceClass; 23 24 25 class DiscoveryListener : BLooper { 26 27 public: 28 29 static const int INQUIRY_COMPLETED = B_BT_INQUIRY_COMPLETED; 30 static const int INQUIRY_TERMINATED = B_BT_INQUIRY_TERMINATED; 31 static const int INQUIRY_ERROR = B_BT_INQUIRY_ERROR; 32 33 static const int SERVICE_SEARCH_COMPLETED = 0x01; 34 static const int SERVICE_SEARCH_TERMINATED = 0x02; 35 static const int SERVICE_SEARCH_ERROR = 0x03; 36 static const int SERVICE_SEARCH_NO_RECORDS = 0x04; 37 static const int SERVICE_SEARCH_DEVICE_NOT_REACHABLE = 0x06; 38 39 virtual void DeviceDiscovered(RemoteDevice btDevice, DeviceClass cod); 40 /* 41 virtual void servicesDiscovered(int transID, ServiceRecord[] servRecord); 42 virtual void serviceSearchCompleted(int transID, int respCode); 43 */ 44 virtual void InquiryCompleted(int discType); 45 46 private: 47 DiscoveryListener(); 48 void MessageReceived(BMessage* msg); 49 50 }; 51 52 } 53 54 #endif 55