Add UI classes to the build.

Adding some helper methods to the Local and remote devices



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26011 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes
2008-06-18 21:01:26 +00:00
parent b12daa5f08
commit 24f4a20d25
5 changed files with 73 additions and 61 deletions
+22 -21
View File
@@ -28,40 +28,41 @@ class LocalDevice : public BluetoothDevice {
public:
/* Possible throwing */
static LocalDevice* GetLocalDevice();
static uint32 GetLocalDeviceCount();
static LocalDevice* GetLocalDevice();
static uint32 GetLocalDeviceCount();
static LocalDevice* GetLocalDevice(hci_id hid);
static LocalDevice* GetLocalDevice(bdaddr_t bdaddr);
static LocalDevice* GetLocalDevice(hci_id hid);
static LocalDevice* GetLocalDevice(bdaddr_t bdaddr);
DiscoveryAgent* GetDiscoveryAgent();
BString GetFriendlyName();
DeviceClass GetDeviceClass();
DiscoveryAgent* GetDiscoveryAgent();
BString GetFriendlyName();
DeviceClass GetDeviceClass();
/* Possible throwing */
status_t SetDiscoverable(int mode);
status_t SetDiscoverable(int mode);
BString GetProperty(const char* property);
void GetProperty(const char* property, uint32* value);
BString GetProperty(const char* property);
void GetProperty(const char* property, uint32* value);
int GetDiscoverable();
bdaddr_t GetBluetoothAddress();
int GetDiscoverable();
bdaddr_t GetBluetoothAddress();
/*
ServiceRecord getRecord(Connection notifier);
void updateRecord(ServiceRecord srvRecord);
ServiceRecord getRecord(Connection notifier);
void updateRecord(ServiceRecord srvRecord);
*/
private:
LocalDevice(hci_id hid);
LocalDevice(hci_id hid);
hci_id GetID(void) {return hid;}
static LocalDevice* RequestLocalDeviceID(BMessage* request);
static LocalDevice* RequestLocalDeviceID(BMessage* request);
static BMessenger* sfMessenger;
BMessenger* fMessenger;
static BMessenger* sfMessenger;
BMessenger* fMessenger;
hci_id hid;
hci_id GetID(void) {return hid;}
hci_id hid;
friend class DiscoveryAgent;
friend class RemoteDevice;
friend class PincodeWindow;
};
}
+8 -10
View File
@@ -25,7 +25,6 @@ class LocalDevice;
class RemoteDevice : public BluetoothDevice {
public:
static const int WAIT = B_BT_WAIT;
static const int SUCCEEDED = B_BT_SUCCEEDED;
@@ -48,24 +47,23 @@ class RemoteDevice : public BluetoothDevice {
BString GetProperty(const char* property); /* Throwing */
void GetProperty(const char* property, uint32* value); /* Throwing */
LocalDevice* GetLocalDeviceOwner();
protected:
RemoteDevice(BString address);
RemoteDevice(bdaddr_t address);
/* Instances of this class only will be done by Discovery[Listener|Agent] TODO */
friend class DiscoveryListener;
/* Instances of this class only would be instantiated by Discovery[Listener|Agent] */
friend class DiscoveryListener;
void SetLocalDeviceOwner(LocalDevice* ld);
private:
void SetLocalDeviceOwner(LocalDevice* ld);
LocalDevice* fDiscovererLocalDevice;
uint8 fPageRepetitionMode;
uint8 fScanPeriodMode;
uint8 fScanMode;
uint16 fClockOffset;
uint8 fPageRepetitionMode;
uint8 fScanPeriodMode;
uint8 fScanMode;
uint16 fClockOffset;
};
+12 -4
View File
@@ -2,11 +2,16 @@ SubDir HAIKU_TOP src kits bluetooth ;
SetSubDirSupportedPlatformsBeOSCompatible ;
if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
UseHeaders [ FDirName $(HAIKU_TOP) headers os ] : true ;
}
#if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
# UseHeaders [ FDirName $(HAIKU_TOP) headers os ] : true ;
#}
UsePrivateHeaders shared bluetooth ;
SubDirHdrs [ FDirName $(SUBDIR) UI ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) UI ] ;
UsePrivateHeaders bluetooth shared ;
SharedLibrary libbluetooth.so :
LocalDevice.cpp
@@ -15,5 +20,8 @@ SharedLibrary libbluetooth.so :
RemoteDevice.cpp
CommandManager.cpp
KitSupport.cpp
#UI
PincodeWindow.cpp
ConnectionIncoming.cpp
: be
;
+2 -2
View File
@@ -152,7 +152,7 @@ LocalDevice::SetDiscoverable(int mode)
BMessage request(BT_MSG_HANDLE_SIMPLE_REQUEST);
BMessage reply;
size_t size;
size_t size;
int8 bt_status = BT_ERROR;
@@ -170,7 +170,7 @@ LocalDevice::SetDiscoverable(int mode)
request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_CONTROL_BASEBAND, OCF_WRITE_SCAN_ENABLE));
if (fMessenger->SendMessage(&request, &reply) == B_OK) {
if (reply.FindInt8("status", &bt_status ) == B_OK ) {
if (reply.FindInt8("status", &bt_status ) == B_OK ) {
return bt_status;
}
+5
View File
@@ -134,6 +134,11 @@ RemoteDevice::IsEncrypted()
return true;
}
LocalDevice*
RemoteDevice::GetLocalDeviceOwner()
{
return fDiscovererLocalDevice;
}
/* Private */
void