LocalDevice:

- Implement REading of the default timeouts
- Retrieval of all possible LinkKeys stored inside the dongle
- Provided function to force an authentication process with remote devices
RemoteDevice:
- Allow Haiku initiate a fully authenticated connection



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36445 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes
2010-04-24 11:34:23 +00:00
parent 40c666a5ab
commit 37c7d5d83a
6 changed files with 189 additions and 22 deletions
+18 -9
View File
@@ -7,6 +7,7 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/DeviceClass.h>
#include <bluetooth/bdaddrUtils.h>
#include <Messenger.h>
#include <Message.h>
@@ -18,23 +19,31 @@ namespace Bluetooth {
class BluetoothDevice {
public:
public:
BluetoothDevice()
:
fBdaddr(bdaddrUtils::NullAddress()),
fDeviceClass()
{
virtual BString GetFriendlyName()=0;
virtual DeviceClass GetDeviceClass()=0;
}
virtual BString GetProperty(const char* property)=0;
virtual status_t GetProperty(const char* property, uint32* value)=0;
virtual BString GetFriendlyName()=0;
virtual DeviceClass GetDeviceClass()=0;
virtual bdaddr_t GetBluetoothAddress()=0;
virtual BString GetProperty(const char* property)=0;
virtual status_t GetProperty(const char* property, uint32* value)=0;
protected:
bdaddr_t fBdaddr;
DeviceClass fDeviceClass;
virtual bdaddr_t GetBluetoothAddress()=0;
protected:
bdaddr_t fBdaddr;
DeviceClass fDeviceClass;
};
}
#ifndef _BT_USE_EXPLICIT_NAMESPACE
using Bluetooth::BluetoothDevice;
#endif
+11
View File
@@ -102,7 +102,13 @@ struct hci_command_header {
char local_name[HCI_DEVICE_NAME_SIZE];
} __attribute__ ((packed));
#define OCF_READ_CA_TIMEOUT 0x0015
#define OCF_WRITE_CA_TIMEOUT 0x0016
#define OCF_READ_PG_TIMEOUT 0x0017
struct hci_rp_read_page_timeout {
uint8 status;
uint16 page_timeout;
} __attribute__ ((packed));
#define OCF_WRITE_PG_TIMEOUT 0x0018
#define OCF_WRITE_SCAN_ENABLE 0x001A
@@ -240,6 +246,11 @@ struct hci_command_header {
uint8 pin_code[HCI_PIN_SIZE];
} __attribute__ ((packed));
struct hci_cp_link_key_reply_reply {
uint8 status;
bdaddr_t bdaddr;
} __attribute__ ((packed));
#define OCF_PIN_CODE_NEG_REPLY 0x000E
struct hci_cp_pin_code_neg_reply {
bdaddr_t bdaddr;
+3 -3
View File
@@ -315,11 +315,11 @@ struct hci_ev_sychronous_connection_changed {
#define HCI_EVENT_REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION 0x3D
/* HAIKU Internal Events, not produced by the transport devices but
* by some entity of the Haiku Bluetooth Stack.
/* HAIKU Internal Events, not produced by the transport devices but
* by some entity of the Haiku Bluetooth Stack.
* The MSB 0xE is chosen for this purpose
*/
#define HCI_HAIKU_EVENT_SERVER_QUITTING 0xE0
#define HCI_HAIKU_EVENT_DEVICE_REMOVED 0xE1
+3
View File
@@ -38,6 +38,7 @@ public:
/* Possible throwing */
status_t SetDiscoverable(int mode);
status_t SetAuthentication(bool authentication);
BString GetProperty(const char* property);
status_t GetProperty(const char* property, uint32* value);
@@ -56,6 +57,8 @@ private:
status_t _ReadLocalVersion();
status_t _ReadBufferSize();
status_t _ReadLocalFeatures();
status_t _ReadTimeouts();
status_t _ReadLinkKeys();
status_t Reset();
static LocalDevice* RequestLocalDeviceID(BMessage* request);