CheckStyled

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34776 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes
2009-12-25 18:46:53 +00:00
parent 4b68462fe1
commit 1f37b29b5d
+19 -17
View File
@@ -38,8 +38,8 @@ LocalDevice::RequestLocalDeviceID(BMessage* request)
if (messenger == NULL) if (messenger == NULL)
return NULL; return NULL;
if (messenger->SendMessage(request, &reply) == B_OK && if (messenger->SendMessage(request, &reply) == B_OK
reply.FindInt32("hci_id", &hid) == B_OK ) { && reply.FindInt32("hci_id", &hid) == B_OK ) {
if (hid >= 0) if (hid >= 0)
lDevice = new (std::nothrow)LocalDevice(hid); lDevice = new (std::nothrow)LocalDevice(hid);
@@ -167,7 +167,6 @@ LocalDevice::SetDiscoverable(int mode)
size_t size; size_t size;
int8 bt_status = BT_ERROR; int8 bt_status = BT_ERROR;
request.AddInt32("hci_id", fHid); request.AddInt32("hci_id", fHid);
@@ -217,10 +216,10 @@ LocalDevice::GetBluetoothAddress()
request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_INFORMATIONAL_PARAM, request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_INFORMATIONAL_PARAM,
OCF_READ_BD_ADDR)); OCF_READ_BD_ADDR));
if (fMessenger->SendMessage(&request, &reply) == B_OK) { if (fMessenger->SendMessage(&request, &reply) == B_OK
if (reply.FindData("bdaddr", B_ANY_TYPE, 0, (const void**)&bdaddr, &ssize) == B_OK ) && reply.FindData("bdaddr", B_ANY_TYPE, 0,
(const void**)&bdaddr, &ssize) == B_OK)
return *bdaddr; return *bdaddr;
}
return bdaddrUtils::LocalAddress(); return bdaddrUtils::LocalAddress();
} }
@@ -255,11 +254,9 @@ LocalDevice::GetFriendlyName()
request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_CONTROL_BASEBAND, request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_CONTROL_BASEBAND,
OCF_READ_LOCAL_NAME)); OCF_READ_LOCAL_NAME));
if (fMessenger->SendMessage(&request, &reply) == B_OK && if (fMessenger->SendMessage(&request, &reply) == B_OK
reply.FindString("friendlyname", &friendlyname) == B_OK){ && reply.FindString("friendlyname", &friendlyname) == B_OK)
return friendlyname; return friendlyname;
}
return BString("Unknown|ServerFailed"); return BString("Unknown|ServerFailed");
} }
@@ -322,7 +319,8 @@ LocalDevice::SetDeviceClass(DeviceClass deviceClass)
BMessage reply; BMessage reply;
request.AddInt32("hci_id", fHid); request.AddInt32("hci_id", fHid);
request.AddData("raw command", B_ANY_TYPE, setDeviceClass.Data(), setDeviceClass.Size()); request.AddData("raw command", B_ANY_TYPE,
setDeviceClass.Data(), setDeviceClass.Size());
request.AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE); request.AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE);
request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_CONTROL_BASEBAND, request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_CONTROL_BASEBAND,
OCF_WRITE_CLASS_OF_DEV)); OCF_WRITE_CLASS_OF_DEV));
@@ -340,13 +338,15 @@ LocalDevice::ReadLocalVersion()
{ {
int8 bt_status = BT_ERROR; int8 bt_status = BT_ERROR;
BluetoothCommand<> localVersion(OGF_INFORMATIONAL_PARAM,OCF_READ_LOCAL_VERSION); BluetoothCommand<> localVersion(OGF_INFORMATIONAL_PARAM,
OCF_READ_LOCAL_VERSION);
BMessage request(BT_MSG_HANDLE_SIMPLE_REQUEST); BMessage request(BT_MSG_HANDLE_SIMPLE_REQUEST);
BMessage reply; BMessage reply;
request.AddInt32("hci_id", fHid); request.AddInt32("hci_id", fHid);
request.AddData("raw command", B_ANY_TYPE, localVersion.Data(), localVersion.Size()); request.AddData("raw command", B_ANY_TYPE,
localVersion.Data(), localVersion.Size());
request.AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE); request.AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE);
request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_INFORMATIONAL_PARAM, request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_INFORMATIONAL_PARAM,
OCF_READ_LOCAL_VERSION)); OCF_READ_LOCAL_VERSION));
@@ -370,7 +370,8 @@ LocalDevice::ReadBufferSize()
BMessage reply; BMessage reply;
request.AddInt32("hci_id", fHid); request.AddInt32("hci_id", fHid);
request.AddData("raw command", B_ANY_TYPE, BufferSize.Data(), BufferSize.Size()); request.AddData("raw command", B_ANY_TYPE,
BufferSize.Data(), BufferSize.Size());
request.AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE); request.AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE);
request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_INFORMATIONAL_PARAM, request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_INFORMATIONAL_PARAM,
OCF_READ_BUFFER_SIZE)); OCF_READ_BUFFER_SIZE));
@@ -389,7 +390,6 @@ LocalDevice::Reset()
BluetoothCommand<> Reset(OGF_CONTROL_BASEBAND, OCF_RESET); BluetoothCommand<> Reset(OGF_CONTROL_BASEBAND, OCF_RESET);
BMessage request(BT_MSG_HANDLE_SIMPLE_REQUEST); BMessage request(BT_MSG_HANDLE_SIMPLE_REQUEST);
BMessage reply; BMessage reply;
@@ -432,9 +432,10 @@ LocalDevice::LocalDevice(hci_id hid) : fHid(hid)
// Uncomment this out if your Broadcom dongle is not working properly // Uncomment this out if your Broadcom dongle is not working properly
// Reset(); // Perform a reset to Broadcom buggyland // Reset(); // Perform a reset to Broadcom buggyland
// Uncomment this out if your Broadcom dongle has a null bdaddr
//#define BT_WRITE_BDADDR_FOR_BCM2035 //#define BT_WRITE_BDADDR_FOR_BCM2035
#ifdef BT_WRITE_BDADDR_FOR_BCM2035 #ifdef BT_WRITE_BDADDR_FOR_BCM2035
#warning Writting broadcom bdaddr @ init.
// try write bdaddr to a bcm2035 -> will be moved to an addon // try write bdaddr to a bcm2035 -> will be moved to an addon
int8 bt_status = BT_ERROR; int8 bt_status = BT_ERROR;
@@ -451,7 +452,8 @@ LocalDevice::LocalDevice(hci_id hid) : fHid(hid)
writeAddress->bdaddr.b[5] = 0x00; writeAddress->bdaddr.b[5] = 0x00;
request.AddInt32("hci_id", fHid); request.AddInt32("hci_id", fHid);
request.AddData("raw command", B_ANY_TYPE, writeAddress.Data(), writeAddress.Size()); request.AddData("raw command", B_ANY_TYPE,
writeAddress.Data(), writeAddress.Size());
request.AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE); request.AddInt16("eventExpected", HCI_EVENT_CMD_COMPLETE);
request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_VENDOR_CMD, request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_VENDOR_CMD,
OCF_WRITE_BCM2035_BDADDR)); OCF_WRITE_BCM2035_BDADDR));