130f1d1f3SOliver Ruiz Dorantes /* 230f1d1f3SOliver Ruiz Dorantes * Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com 330f1d1f3SOliver Ruiz Dorantes * 430f1d1f3SOliver Ruiz Dorantes * All rights reserved. Distributed under the terms of the MIT License. 530f1d1f3SOliver Ruiz Dorantes * 630f1d1f3SOliver Ruiz Dorantes */ 730f1d1f3SOliver Ruiz Dorantes 830f1d1f3SOliver Ruiz Dorantes #ifndef _LOCALDEVICE_HANDLER_H_ 930f1d1f3SOliver Ruiz Dorantes #define _LOCALDEVICE_HANDLER_H_ 1030f1d1f3SOliver Ruiz Dorantes 1130f1d1f3SOliver Ruiz Dorantes #include <String.h> 1230f1d1f3SOliver Ruiz Dorantes 1330f1d1f3SOliver Ruiz Dorantes #include <MessageQueue.h> 1430f1d1f3SOliver Ruiz Dorantes 1530f1d1f3SOliver Ruiz Dorantes #include <bluetooth/bluetooth.h> 1630f1d1f3SOliver Ruiz Dorantes 1730f1d1f3SOliver Ruiz Dorantes #include "HCIDelegate.h" 1830f1d1f3SOliver Ruiz Dorantes 1930f1d1f3SOliver Ruiz Dorantes class LocalDeviceHandler { 2030f1d1f3SOliver Ruiz Dorantes 2130f1d1f3SOliver Ruiz Dorantes public: 2230f1d1f3SOliver Ruiz Dorantes 23d04eb939SOliver Ruiz Dorantes hci_id GetID(); 2430f1d1f3SOliver Ruiz Dorantes 25d04eb939SOliver Ruiz Dorantes bool Available(); 2630f1d1f3SOliver Ruiz Dorantes void Acquire(void); 27d04eb939SOliver Ruiz Dorantes status_t Launch(void); 2830f1d1f3SOliver Ruiz Dorantes GetPropertiesMessage(void)2930f1d1f3SOliver Ruiz Dorantes BMessage* GetPropertiesMessage(void) { return fProperties; } 30*3fdaa5bfSOliver Ruiz Dorantes bool IsPropertyAvailable(const char* property); 3130f1d1f3SOliver Ruiz Dorantes 3230f1d1f3SOliver Ruiz Dorantes 3330f1d1f3SOliver Ruiz Dorantes protected: 3430f1d1f3SOliver Ruiz Dorantes LocalDeviceHandler (HCIDelegate* hd); 3530f1d1f3SOliver Ruiz Dorantes virtual ~LocalDeviceHandler(); 3630f1d1f3SOliver Ruiz Dorantes 3730f1d1f3SOliver Ruiz Dorantes HCIDelegate* fHCIDelegate; 3830f1d1f3SOliver Ruiz Dorantes BMessage* fProperties; 3930f1d1f3SOliver Ruiz Dorantes 4030f1d1f3SOliver Ruiz Dorantes void AddWantedEvent(BMessage* msg); 41fd223db5SOliver Ruiz Dorantes void ClearWantedEvent(BMessage* msg, uint16 event, uint16 opcode = 0); 42fd223db5SOliver Ruiz Dorantes void ClearWantedEvent(BMessage* msg); 43fd223db5SOliver Ruiz Dorantes 44480cccf6SOliver Ruiz Dorantes BMessage* FindPetition(uint16 event, uint16 opcode = 0, int32* indexFound = NULL); 4530f1d1f3SOliver Ruiz Dorantes 4630f1d1f3SOliver Ruiz Dorantes private: 4730f1d1f3SOliver Ruiz Dorantes 4830f1d1f3SOliver Ruiz Dorantes BMessageQueue fEventsWanted; 4930f1d1f3SOliver Ruiz Dorantes 5030f1d1f3SOliver Ruiz Dorantes 5130f1d1f3SOliver Ruiz Dorantes }; 5230f1d1f3SOliver Ruiz Dorantes 5330f1d1f3SOliver Ruiz Dorantes #endif 54