A bit more styling on main headers
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26743 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BLUETOOTH_DEVICE_H
|
||||
#define _BLUETOOTH_DEVICE_H
|
||||
|
||||
@@ -42,4 +39,4 @@ class BluetoothDevice {
|
||||
using Bluetooth::BluetoothDevice;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // _BLUETOOTH_DEVICE_H
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DEVICE_CLASS_H
|
||||
#define _DEVICE_CLASS_H
|
||||
|
||||
@@ -14,7 +11,7 @@ namespace Bluetooth {
|
||||
|
||||
class DeviceClass {
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
DeviceClass(int record)
|
||||
{
|
||||
@@ -56,7 +53,7 @@ class DeviceClass {
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
int record;
|
||||
};
|
||||
|
||||
@@ -66,4 +63,4 @@ class DeviceClass {
|
||||
using Bluetooth::DeviceClass;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // _DEVICE_CLASS_H
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007-2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DISCOVERY_AGENT_H
|
||||
#define _DISCOVERY_AGENT_H
|
||||
|
||||
@@ -30,7 +27,7 @@ class RemoteDevice;
|
||||
|
||||
class DiscoveryAgent {
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
static const int GIAC = BT_GIAC;
|
||||
static const int LIAC = BT_LIAC;
|
||||
@@ -52,7 +49,7 @@ class DiscoveryAgent {
|
||||
BString selectService(UUID uuid, int security, boolean master);
|
||||
*/
|
||||
|
||||
private:
|
||||
private:
|
||||
DiscoveryAgent(LocalDevice* ld);
|
||||
~DiscoveryAgent();
|
||||
void SetLocalDeviceOwner(LocalDevice* ld);
|
||||
@@ -70,4 +67,4 @@ class DiscoveryAgent {
|
||||
using Bluetooth::DiscoveryAgent;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // _DISCOVERY_AGENT_H
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DISCOVERY_LISTENER_H
|
||||
#define _DISCOVERY_LISTENER_H
|
||||
|
||||
@@ -29,7 +26,7 @@ class LocalDevice;
|
||||
|
||||
class DiscoveryListener : public BLooper {
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
static const int INQUIRY_COMPLETED = BT_INQUIRY_COMPLETED;
|
||||
static const int INQUIRY_TERMINATED = BT_INQUIRY_TERMINATED;
|
||||
@@ -51,7 +48,7 @@ class DiscoveryListener : public BLooper {
|
||||
/* JSR82 non-defined methods */
|
||||
virtual void InquiryStarted(status_t status);
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
RemoteDevicesList GetRemoteDevicesList(void);
|
||||
|
||||
@@ -62,7 +59,7 @@ class DiscoveryListener : public BLooper {
|
||||
|
||||
friend class DiscoveryAgent;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
DiscoveryListener();
|
||||
void SetLocalDeviceOwner(LocalDevice* ld);
|
||||
};
|
||||
@@ -73,4 +70,4 @@ class DiscoveryListener : public BLooper {
|
||||
using Bluetooth::DiscoveryListener;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // _DISCOVERY_LISTENER_H
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BTHCI_H_
|
||||
#define _BTHCI_H_
|
||||
|
||||
@@ -38,4 +35,4 @@ typedef enum { BT_COMMAND = 0,
|
||||
#define HCI_FEATURES_SIZE 8 /* LMP features */
|
||||
#define HCI_DEVICE_NAME_SIZE 248 /* unit name size */
|
||||
|
||||
#endif
|
||||
#endif // _BTHCI_H_
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BTHCI_ACL_H_
|
||||
#define _BTHCI_ACL_H_
|
||||
|
||||
@@ -36,4 +33,4 @@ struct hci_acl_header {
|
||||
#define HCI_ACL_BROADCAST_PICONET 0x2 /* both directions */
|
||||
/* 11 - reserved for future use */
|
||||
|
||||
#endif
|
||||
#endif // _BTHCI_ACL_H_
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BTHCI_COMMAND_H_
|
||||
#define _BTHCI_COMMAND_H_
|
||||
|
||||
@@ -337,4 +334,4 @@ struct hci_command_header {
|
||||
/* Vendor specific commands */
|
||||
#define OGF_VENDOR_CMD 0x3F
|
||||
|
||||
#endif
|
||||
#endif // _BTHCI_COMMAND_H_
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
* Copyright 2008 Mika Lindqvist, monni1995_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BTHCI_EVENT_H_
|
||||
#define _BTHCI_EVENT_H_
|
||||
|
||||
@@ -318,8 +315,6 @@ 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.
|
||||
* The MSB 0xE is chosen for this purpose
|
||||
@@ -329,4 +324,4 @@ struct hci_ev_sychronous_connection_changed {
|
||||
#define HCI_HAIKU_EVENT_DEVICE_REMOVED 0xE1
|
||||
|
||||
|
||||
#endif
|
||||
#endif // _BTHCI_EVENT_H_
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BTHCI_MODULE_H_
|
||||
#define _BTHCI_MODULE_H_
|
||||
|
||||
@@ -35,4 +32,4 @@ typedef struct bt_hci_module_info {
|
||||
} bt_hci_module_info ;
|
||||
|
||||
|
||||
#endif
|
||||
#endif // _BTHCI_MODULE_H_
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BTHCI_TRANSPORT_H_
|
||||
#define _BTHCI_TRANSPORT_H_
|
||||
|
||||
@@ -99,4 +96,4 @@ enum {
|
||||
at moment refer to ioctl GET_NOTIFICATION_PORT)*/
|
||||
#define BT_USERLAND_PORT_NAME "BT kernel-user Land"
|
||||
|
||||
#endif
|
||||
#endif // _BTHCI_TRANSPORT_H_
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BTL2CAP_H_
|
||||
@@ -18,4 +16,4 @@ struct sockaddr_l2cap {
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif // _BTL2CAP_H_
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2008 Mika Lindqvist, monni1995_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LINKKEY_UTILS_H
|
||||
#define _LINKKEY_UTILS_H
|
||||
|
||||
@@ -19,25 +16,23 @@ class LinkKeyUtils {
|
||||
public:
|
||||
static bool Compare(linkkey_t* lk1, linkkey_t* lk2)
|
||||
{
|
||||
return (memcmp(lk1, lk2, sizeof(linkkey_t)) == 0);
|
||||
return memcmp(lk1, lk2, sizeof(linkkey_t)) == 0;
|
||||
}
|
||||
|
||||
static linkkey_t NullKey()
|
||||
{
|
||||
return (linkkey_t) {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
|
||||
return (linkkey_t){{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
|
||||
}
|
||||
|
||||
static char* ToString(const linkkey_t lk)
|
||||
{
|
||||
|
||||
// TODO: not safe
|
||||
static char str[50];
|
||||
|
||||
sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:"
|
||||
"%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
|
||||
lk.l[0], lk.l[1], lk.l[2], lk.l[3],
|
||||
lk.l[4], lk.l[5], lk.l[6], lk.l[7],
|
||||
lk.l[8], lk.l[9], lk.l[10], lk.l[11],
|
||||
lk.l[0], lk.l[1], lk.l[2], lk.l[3], lk.l[4], lk.l[5],
|
||||
lk.l[6], lk.l[7], lk.l[8], lk.l[9], lk.l[10], lk.l[11],
|
||||
lk.l[12], lk.l[13], lk.l[14], lk.l[15]);
|
||||
|
||||
return str;
|
||||
@@ -45,22 +40,20 @@ public:
|
||||
|
||||
static linkkey_t FromString(const char *lkstr)
|
||||
{
|
||||
if (lkstr != NULL)
|
||||
{
|
||||
if (lkstr != NULL) {
|
||||
int l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15;
|
||||
size_t count = sscanf(lkstr, "%2X:%2X:%2X:%2X:%2X:%2X:%2X:%2X:"
|
||||
"%2X:%2X:%2X:%2X:%2X:%2X:%2X:%2X",
|
||||
&l0, &l1, &l2, &l3, &l4, &l5, &l6, &l7,
|
||||
&l8, &l9, &l10, &l11, &l12, &l13, &l14, &l15);
|
||||
"%2X:%2X:%2X:%2X:%2X:%2X:%2X:%2X", &l0, &l1, &l2, &l3,
|
||||
&l4, &l5, &l6, &l7, &l8, &l9, &l10, &l11, &l12, &l13,
|
||||
&l14, &l15);
|
||||
|
||||
if (count == 16)
|
||||
{
|
||||
return (linkkey_t) {{l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15}};
|
||||
if (count == 16) {
|
||||
return (linkkey_t){{l0, l1, l2, l3, l4, l5, l6, l7, l8,
|
||||
l9, l10, l11, l12, l13, l14, l15}};
|
||||
}
|
||||
}
|
||||
|
||||
return NullKey();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -70,4 +63,4 @@ public:
|
||||
using Bluetooth::LinkKeyUtils;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // _LINKKEY_UTILS_H
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LOCAL_DEVICE_H
|
||||
#define _LOCAL_DEVICE_H
|
||||
|
||||
@@ -26,7 +23,7 @@ class DiscoveryAgent;
|
||||
|
||||
class LocalDevice : public BluetoothDevice {
|
||||
|
||||
public:
|
||||
public:
|
||||
/* Possible throwing */
|
||||
static LocalDevice* GetLocalDevice();
|
||||
static uint32 GetLocalDeviceCount();
|
||||
@@ -50,7 +47,7 @@ class LocalDevice : public BluetoothDevice {
|
||||
void updateRecord(ServiceRecord srvRecord);
|
||||
*/
|
||||
|
||||
private:
|
||||
private:
|
||||
LocalDevice(hci_id hid);
|
||||
virtual ~LocalDevice();
|
||||
|
||||
@@ -72,4 +69,4 @@ class LocalDevice : public BluetoothDevice {
|
||||
using Bluetooth::LocalDevice;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // _LOCAL_DEVICE_H
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _REMOTE_DEVICE_H
|
||||
#define _REMOTE_DEVICE_H
|
||||
|
||||
@@ -24,7 +21,7 @@ class LocalDevice;
|
||||
|
||||
class RemoteDevice : public BluetoothDevice {
|
||||
|
||||
public:
|
||||
public:
|
||||
static const int WAIT = B_BT_WAIT;
|
||||
static const int SUCCEEDED = B_BT_SUCCEEDED;
|
||||
|
||||
@@ -54,12 +51,12 @@ class RemoteDevice : public BluetoothDevice {
|
||||
RemoteDevice(BString address);
|
||||
RemoteDevice(bdaddr_t address);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
/* called by Discovery[Listener|Agent] */
|
||||
void SetLocalDeviceOwner(LocalDevice* ld);
|
||||
friend class DiscoveryListener;
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
LocalDevice* fDiscovererLocalDevice;
|
||||
BMessenger* fMessenger;
|
||||
@@ -77,4 +74,4 @@ class RemoteDevice : public BluetoothDevice {
|
||||
using Bluetooth::RemoteDevice;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // _REMOTE_DEVICE_H
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
* Copyright 2008 Mika Lindqvist, monni1995_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BDADDR_UTILS_H
|
||||
#define _BDADDR_UTILS_H
|
||||
|
||||
@@ -17,7 +14,7 @@ namespace Bluetooth {
|
||||
|
||||
class bdaddrUtils {
|
||||
|
||||
public:
|
||||
public:
|
||||
static inline bdaddr_t NullAddress()
|
||||
{
|
||||
return ((bdaddr_t) {{0, 0, 0, 0, 0, 0}});
|
||||
@@ -78,4 +75,4 @@ using Bluetooth::bdaddrUtils;
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
#endif // _BDADDR_UTILS_H
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
* Copyright 2008 Mika Lindqvist, monni1995_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BLUETOOTH_H
|
||||
#define _BLUETOOTH_H
|
||||
|
||||
@@ -55,4 +52,4 @@ typedef struct int128 uint128;
|
||||
#define BLUETOOTH_PROTO_MAX 256
|
||||
|
||||
|
||||
#endif
|
||||
#endif // _BLUETOOTH_H
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BLUETOOTH_ERROR_H
|
||||
#define _BLUETOOTH_ERROR_H
|
||||
|
||||
@@ -71,4 +68,4 @@
|
||||
#define HOST_BUSY_PAIRING 0x38
|
||||
|
||||
|
||||
#endif
|
||||
#endif // _BLUETOOTH_ERROR_H
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
||||
*
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BLUETOOTH_UTIL_H
|
||||
#define _BLUETOOTH_UTIL_H
|
||||
|
||||
@@ -55,4 +52,4 @@ static inline char* btstrerror(int error_code)
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif // _BLUETOOTH_UTIL_H
|
||||
|
||||
Reference in New Issue
Block a user