More Stylistic changes

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26705 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes
2008-07-31 21:08:27 +00:00
parent b48fa68ace
commit 26e7ba5602
6 changed files with 115 additions and 125 deletions
-1
View File
@@ -11,7 +11,6 @@
#include <bluetooth/bluetooth.h> #include <bluetooth/bluetooth.h>
#include <bluetooth/DeviceClass.h> #include <bluetooth/DeviceClass.h>
#include <Messenger.h> #include <Messenger.h>
#include <Message.h> #include <Message.h>
+1 -3
View File
@@ -45,9 +45,7 @@ class DiscoveryAgent {
status_t CancelInquiry(DiscoveryListener* listener); status_t CancelInquiry(DiscoveryListener* listener);
/* /*
int searchServices(int[] attrSet, int searchServices(int[] attrSet, UUID[] uuidSet, RemoteDevice btDev,
UUID[] uuidSet,
RemoteDevice btDev,
DiscoveryListener discListener); DiscoveryListener discListener);
bool cancelServiceSearch(int transID); bool cancelServiceSearch(int transID);
+5 -5
View File
@@ -48,13 +48,13 @@ typedef struct bt_hci_statistics {
} bt_hci_statistics; } bt_hci_statistics;
/* TODO: Possible Hooks which drivers will have to provide */ /* TODO: Possible hooks which drivers will have to provide */
typedef struct bt_hci_transport { typedef struct bt_hci_transport {
status_t (*SendCommand)(hci_id hci_dev, net_buffer* snbuf); status_t (*SendCommand)(hci_id hci_dev, net_buffer *snbuf);
status_t (*SendPacket)(hci_id hci_dev, net_buffer* nbuf ); status_t (*SendPacket)(hci_id hci_dev, net_buffer *nbuf );
status_t (*SendSCO)(hci_id hci_dev, net_buffer* nbuf ); status_t (*SendSCO)(hci_id hci_dev, net_buffer *nbuf );
status_t (*DeliverStatistics)(bt_hci_statistics* statistics); status_t (*DeliverStatistics)(bt_hci_statistics *statistics);
transport_type kind; transport_type kind;
char name[B_OS_NAME_LENGTH]; char name[B_OS_NAME_LENGTH];
+8 -15
View File
@@ -1,5 +1,6 @@
/* /*
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com * 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. * All rights reserved. Distributed under the terms of the MIT License.
* *
@@ -19,26 +20,23 @@ class bdaddrUtils {
public: public:
static inline bdaddr_t NullAddress() static inline bdaddr_t NullAddress()
{ {
return ((bdaddr_t) {{0, 0, 0, 0, 0, 0}}); return ((bdaddr_t) {{0, 0, 0, 0, 0, 0}});
} }
static inline bdaddr_t LocalAddress() static inline bdaddr_t LocalAddress()
{ {
return ((bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}); return ((bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}});
} }
static inline bdaddr_t BroadcastAddress() static inline bdaddr_t BroadcastAddress()
{ {
return ((bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}}); return ((bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}});
} }
static bool Compare(bdaddr_t* ba1, bdaddr_t* ba2) static bool Compare(bdaddr_t *ba1, bdaddr_t *ba2)
{ {
return (memcmp(ba1, ba2, sizeof(bdaddr_t)) == 0); return (memcmp(ba1, ba2, sizeof(bdaddr_t)) == 0);
} }
@@ -50,28 +48,23 @@ class bdaddrUtils {
static char str[18]; static char str[18];
sprintf(str,"%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",bdaddr.b[0], sprintf(str,"%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",bdaddr.b[0],
bdaddr.b[1], bdaddr.b[1], bdaddr.b[2], bdaddr.b[3], bdaddr.b[4],
bdaddr.b[2],
bdaddr.b[3],
bdaddr.b[4],
bdaddr.b[5]); bdaddr.b[5]);
return str; return str;
} }
static bdaddr_t FromString(const char * addr) static bdaddr_t FromString(const char * addr)
{ {
int b0, b1, b2, b3, b4, b5; int b0, b1, b2, b3, b4, b5;
if (addr != NULL) {
size_t count = sscanf(addr, "%2X:%2X:%2X:%2X:%2X:%2X", size_t count = sscanf(addr, "%2X:%2X:%2X:%2X:%2X:%2X",
&b0, &b0, &b1, &b2, &b3, &b4, &b5);
&b1,
&b2,
&b3,
&b4,
&b5);
if (count == 6) if (count == 6)
return ((bdaddr_t) {{b0, b1, b2, b3, b4, b5}}); return ((bdaddr_t) {{b0, b1, b2, b3, b4, b5}});
}
return NullAddress(); return NullAddress();
} }