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 19class LocalDeviceHandler { 20 21public: 22 23 hci_id GetID(); 24 25 bool Available(); 26 void Acquire(void); 27 status_t Launch(void); 28 29 BMessage* GetPropertiesMessage(void) { return fProperties; } 30 bool IsPropertyAvailable(const char* property); 31 32 33protected: 34 LocalDeviceHandler (HCIDelegate* hd); 35 virtual ~LocalDeviceHandler(); 36 37 HCIDelegate* fHCIDelegate; 38 BMessage* fProperties; 39 40 void AddWantedEvent(BMessage* msg); 41 void ClearWantedEvent(BMessage* msg, uint16 event, uint16 opcode = 0); 42 void ClearWantedEvent(BMessage* msg); 43 44 BMessage* FindPetition(uint16 event, uint16 opcode = 0, int32* indexFound = NULL); 45 46private: 47 48 BMessageQueue fEventsWanted; 49 50 51}; 52 53#endif 54