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 _LOCALDEVICE_HANDLER_H_ 9 #define _LOCALDEVICE_HANDLER_H_ 10 11 #include <String.h> 12 13 #include <MessageQueue.h> 14 15 #include <bluetooth/bluetooth.h> 16 17 #include "HCIDelegate.h" 18 19 class LocalDeviceHandler { 20 21 public: 22 23 virtual hci_id GetID(); 24 25 virtual bool Available(); 26 void Acquire(void); 27 28 BMessage* GetPropertiesMessage(void) { return fProperties; } 29 bool IsPropertyAvailable(const BString& property); 30 31 32 protected: 33 LocalDeviceHandler (HCIDelegate* hd); 34 virtual ~LocalDeviceHandler(); 35 36 HCIDelegate* fHCIDelegate; 37 BMessage* fProperties; 38 39 void AddWantedEvent(BMessage* msg); 40 void ClearWantedEvent(BMessage* msg, uint16 event, uint16 opcode = 0); 41 void ClearWantedEvent(BMessage* msg); 42 43 BMessage* FindPetition(uint16 event, uint16 opcode = 0); 44 45 private: 46 47 BMessageQueue fEventsWanted; 48 49 50 }; 51 52 #endif 53