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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user