"//stack/include",
]
- # TODO(dennischeng): Add libchrome as a dependency.
+ deps = [
+ "//third_party/libchrome",
+ ]
}
# TODO(dennischeng): Add a unit test target.
#include <vector>
#include <unordered_map>
-#include <base/macros.h>
+#include "base/macros.h"
namespace test_vendor_lib {
#pragma once
-#include "vendor_libs/test_vendor_lib/include/packet.h"
-
#include <cstdint>
#include <vector>
-#include <base/macros.h>
+#include "base/macros.h"
+#include "vendor_libs/test_vendor_lib/include/packet.h"
namespace test_vendor_lib {
#pragma once
-#include "vendor_libs/test_vendor_lib/include/packet.h"
-
#include <cstdint>
#include <memory>
#include <vector>
+#include "vendor_libs/test_vendor_lib/include/packet.h"
+
namespace test_vendor_lib {
// The following is specified in the Bluetooth Core Specification Version 4.2,
#pragma once
-#include "vendor_libs/test_vendor_lib/include/command_packet.h"
-#include "vendor_libs/test_vendor_lib/include/packet.h"
-
#include <cstdint>
#include <memory>
#include <unordered_map>
#include <vector>
-#include <base/macros.h>
+#include "base/macros.h"
+#include "vendor_libs/test_vendor_lib/include/command_packet.h"
+#include "vendor_libs/test_vendor_lib/include/packet.h"
namespace test_vendor_lib {
#pragma once
-#include "vendor_libs/test_vendor_lib/include/command_packet.h"
-#include "vendor_libs/test_vendor_lib/include/event_packet.h"
-#include "vendor_libs/test_vendor_lib/include/packet.h"
-#include "vendor_libs/test_vendor_lib/include/packet_stream.h"
-
#include <functional>
#include <memory>
#include <queue>
-#include <base/macros.h>
-
extern "C" {
#include <sys/epoll.h>
} // extern "C"
+#include "base/macros.h"
+#include "vendor_libs/test_vendor_lib/include/command_packet.h"
+#include "vendor_libs/test_vendor_lib/include/event_packet.h"
+#include "vendor_libs/test_vendor_lib/include/packet.h"
+#include "vendor_libs/test_vendor_lib/include/packet_stream.h"
+
namespace test_vendor_lib {
// Manages communication channel between HCI and the controller. Listens for
#pragma once
-#include "vendor_libs/test_vendor_lib/include/command_packet.h"
-#include "vendor_libs/test_vendor_lib/include/event_packet.h"
-#include "vendor_libs/test_vendor_lib/include/packet.h"
-
#include <cstdint>
#include <vector>
#include <memory>
+#include "vendor_libs/test_vendor_lib/include/command_packet.h"
+#include "vendor_libs/test_vendor_lib/include/event_packet.h"
+#include "vendor_libs/test_vendor_lib/include/packet.h"
+
namespace test_vendor_lib {
// Provides abstractions for IO with Packet objects. Used to receive commands
#define LOG_TAG "bredr_controller"
#include "vendor_libs/test_vendor_lib/include/bredr_controller.h"
+
+#include "base/logging.h"
#include "vendor_libs/test_vendor_lib/include/event_packet.h"
#include "vendor_libs/test_vendor_lib/include/hci_handler.h"
#include "vendor_libs/test_vendor_lib/include/hci_transport.h"
extern "C" {
#include "stack/include/hcidefs.h"
#include "osi/include/log.h"
-
-#include <assert.h>
} // extern "C"
namespace {
// static
BREDRController* BREDRController::Get() {
// Initialize should have been called already.
- // TODO(dennischeng): use CHECK and DCHECK when libbase is imported.
- assert(g_controller);
+ CHECK(g_controller);
return g_controller;
}
// static
void BREDRController::Initialize() {
// Multiple calls to Initialize should not be made.
- // TODO(dennischeng): use CHECK and DCHECK when libbase is imported.
- assert(!g_controller);
+ CHECK(!g_controller);
g_controller = new BREDRController();
}
void BREDRController::HciWriteInquiryMode(const std::vector<uint8_t>& args) {
LogCommand("Write Inquiry Mode");
- assert(args.size() == 1);
+ CHECK(args.size() == 1);
inquiry_mode_ = args[0];
SendEmptySuccessCommandComplete(HCI_WRITE_INQUIRY_MODE);
}
#define LOG_TAG "bt_vendor"
+#include <pthread.h>
+
+#include "base/logging.h"
#include "hci/include/bt_vendor_lib.h"
#include "vendor_libs/test_vendor_lib/include/bredr_controller.h"
#include "vendor_libs/test_vendor_lib/include/hci_handler.h"
#include "vendor_libs/test_vendor_lib/include/hci_transport.h"
-#include <pthread.h>
-
extern "C" {
#include "osi/include/log.h"
-#include <assert.h>
#include <unistd.h>
} // extern "C"
unsigned char* /* local_bdaddr */) {
LOG_INFO(LOG_TAG, "Initializing test controller.");
- // TODO(dennischeng): use CHECK and DCHECK when libbase is imported.
- assert(p_cb);
+ CHECK(p_cb);
vendor_callbacks = const_cast<bt_vendor_callbacks_t*>(p_cb);
// Initialize global objects. The order of initialization does not matter,
#include "hci/include/hci_hal.h"
#include "osi/include/log.h"
#include "stack/include/hcidefs.h"
-
-#include <assert.h>
} // extern "C"
namespace test_vendor_lib {
extern "C" {
#include "osi/include/log.h"
#include "stack/include/hcidefs.h"
-
-#include <assert.h>
} // extern "C"
namespace test_vendor_lib {
#define LOG_TAG "hci_handler"
#include "vendor_libs/test_vendor_lib/include/hci_handler.h"
+
+#include "base/logging.h"
#include "vendor_libs/test_vendor_lib/include/hci_transport.h"
extern "C" {
#include "osi/include/log.h"
-
-#include <assert.h>
} // extern "C"
namespace test_vendor_lib {
// static
HciHandler* HciHandler::Get() {
// Initialize should have been called already.
- // TODO(dennischeng): use CHECK and DCHECK when libbase is imported.
- assert(g_handler);
+ CHECK(g_handler);
return g_handler;
}
// static
void HciHandler::Initialize() {
// Multiple calls to Initialize should not be made.
- // TODO(dennischeng): use CHECK and DCHECK when libbase is imported.
- assert(!g_handler);
+ CHECK(!g_handler);
g_handler = new HciHandler();
}
#include "vendor_libs/test_vendor_lib/include/hci_transport.h"
-extern "C" {
-#include "stack/include/hcidefs.h"
-#include "osi/include/log.h"
+#include "base/logging.h"
+extern "C" {
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/un.h>
-#include <assert.h>
#include <fcntl.h>
#include <unistd.h>
+
+#include "stack/include/hcidefs.h"
+#include "osi/include/log.h"
} // extern "C"
namespace {
// static
HciTransport* HciTransport::Get() {
// Initialize should have been called already.
- // TODO(dennischeng): use CHECK and DCHECK when libbase is imported.
- assert(g_transporter);
+ CHECK(g_transporter);
return g_transporter;
}
// static
void HciTransport::Initialize() {
// Multiple calls to Initialize should not be made.
- // TODO(dennischeng): use CHECK and DCHECK when libbase is imported.
- assert(!g_transporter);
+ CHECK(!g_transporter);
g_transporter = new HciTransport();
}
#include "vendor_libs/test_vendor_lib/include/packet.h"
+#include "base/logging.h"
+
#include <algorithm>
extern "C" {
const std::vector<uint8_t>& Packet::GetHeader() const {
// Every packet must have a header.
- assert(GetHeaderSize() > 0);
+ CHECK(GetHeaderSize() > 0);
return header_;
}
#include "vendor_libs/test_vendor_lib/include/packet_stream.h"
-extern "C" {
-#include "osi/include/log.h"
+#include "base/logging.h"
+extern "C" {
#include <errno.h>
#include <unistd.h>
+
+#include "osi/include/log.h"
} // extern "C"
namespace test_vendor_lib {
bool PacketStream::SendAll(const std::vector<uint8_t>& source,
size_t num_octets_to_send) const {
- // TODO(dennischeng): use CHECK and DCHECK when libbase is imported.
- assert(source.size() >= num_octets_to_send);
+ CHECK(source.size() >= num_octets_to_send);
size_t octets_remaining = num_octets_to_send;
do {
int num_octets_sent = write(