1*30f1d1f3SOliver Ruiz Dorantes /* 2*30f1d1f3SOliver Ruiz Dorantes * Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com 3*30f1d1f3SOliver Ruiz Dorantes * 4*30f1d1f3SOliver Ruiz Dorantes * All rights reserved. Distributed under the terms of the MIT License. 5*30f1d1f3SOliver Ruiz Dorantes * 6*30f1d1f3SOliver Ruiz Dorantes */ 7*30f1d1f3SOliver Ruiz Dorantes 8*30f1d1f3SOliver Ruiz Dorantes #ifndef _LOCALDEVICE_HANDLER_H_ 9*30f1d1f3SOliver Ruiz Dorantes #define _LOCALDEVICE_HANDLER_H_ 10*30f1d1f3SOliver Ruiz Dorantes 11*30f1d1f3SOliver Ruiz Dorantes #include <String.h> 12*30f1d1f3SOliver Ruiz Dorantes 13*30f1d1f3SOliver Ruiz Dorantes #include <MessageQueue.h> 14*30f1d1f3SOliver Ruiz Dorantes 15*30f1d1f3SOliver Ruiz Dorantes #include <bluetooth/bluetooth.h> 16*30f1d1f3SOliver Ruiz Dorantes 17*30f1d1f3SOliver Ruiz Dorantes #include "HCIDelegate.h" 18*30f1d1f3SOliver Ruiz Dorantes 19*30f1d1f3SOliver Ruiz Dorantes class LocalDeviceHandler { 20*30f1d1f3SOliver Ruiz Dorantes 21*30f1d1f3SOliver Ruiz Dorantes public: 22*30f1d1f3SOliver Ruiz Dorantes 23*30f1d1f3SOliver Ruiz Dorantes virtual hci_id GetID(); 24*30f1d1f3SOliver Ruiz Dorantes 25*30f1d1f3SOliver Ruiz Dorantes virtual bool Available(); 26*30f1d1f3SOliver Ruiz Dorantes void Acquire(void); 27*30f1d1f3SOliver Ruiz Dorantes 28*30f1d1f3SOliver Ruiz Dorantes BMessage* GetPropertiesMessage(void) { return fProperties; } 29*30f1d1f3SOliver Ruiz Dorantes bool IsPropertyAvailable(const BString& property); 30*30f1d1f3SOliver Ruiz Dorantes 31*30f1d1f3SOliver Ruiz Dorantes 32*30f1d1f3SOliver Ruiz Dorantes protected: 33*30f1d1f3SOliver Ruiz Dorantes LocalDeviceHandler (HCIDelegate* hd); 34*30f1d1f3SOliver Ruiz Dorantes virtual ~LocalDeviceHandler(); 35*30f1d1f3SOliver Ruiz Dorantes 36*30f1d1f3SOliver Ruiz Dorantes HCIDelegate* fHCIDelegate; 37*30f1d1f3SOliver Ruiz Dorantes BMessage* fProperties; 38*30f1d1f3SOliver Ruiz Dorantes 39*30f1d1f3SOliver Ruiz Dorantes void AddWantedEvent(BMessage* msg); 40*30f1d1f3SOliver Ruiz Dorantes void ClearWantedEvent(BMessage* msg, uint16 code, uint16 opcode = 0); 41*30f1d1f3SOliver Ruiz Dorantes BMessage* FindPetition(uint16 event, uint16 opcode = 0); 42*30f1d1f3SOliver Ruiz Dorantes 43*30f1d1f3SOliver Ruiz Dorantes private: 44*30f1d1f3SOliver Ruiz Dorantes 45*30f1d1f3SOliver Ruiz Dorantes BMessageQueue fEventsWanted; 46*30f1d1f3SOliver Ruiz Dorantes 47*30f1d1f3SOliver Ruiz Dorantes 48*30f1d1f3SOliver Ruiz Dorantes }; 49*30f1d1f3SOliver Ruiz Dorantes 50*30f1d1f3SOliver Ruiz Dorantes #endif 51