mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Removed platform types dependency from windows platform codes
PiperOrigin-RevId: 676447748
This commit is contained in:
committed by
Copybara-Service
parent
a9e753e1e1
commit
47f2dfec28
@@ -21,6 +21,8 @@
|
||||
#include "absl/synchronization/mutex.h"
|
||||
#include "absl/synchronization/notification.h"
|
||||
#include "internal/platform/exception.h"
|
||||
#include "internal/platform/implementation/ble_v2.h"
|
||||
#include "internal/platform/implementation/bluetooth_adapter.h"
|
||||
#include "internal/platform/implementation/windows/ble_v2_socket.h"
|
||||
#include "internal/platform/implementation/windows/bluetooth_adapter.h"
|
||||
#include "internal/platform/implementation/windows/utils.h"
|
||||
@@ -36,7 +38,7 @@ BleV2ServerSocket::BleV2ServerSocket(api::BluetoothAdapter* adapter)
|
||||
|
||||
std::unique_ptr<api::ble_v2::BleSocket> BleV2ServerSocket::Accept() {
|
||||
absl::MutexLock lock(&mutex_);
|
||||
NEARBY_LOGS(INFO) << __func__ << ": Accept is called.";
|
||||
LOG(INFO) << __func__ << ": Accept is called.";
|
||||
|
||||
while (!closed_ && pending_sockets_.empty()) {
|
||||
cond_.Wait(&mutex_);
|
||||
@@ -46,14 +48,14 @@ std::unique_ptr<api::ble_v2::BleSocket> BleV2ServerSocket::Accept() {
|
||||
BleV2Socket ble_socket = pending_sockets_.front();
|
||||
pending_sockets_.pop_front();
|
||||
|
||||
NEARBY_LOGS(INFO) << __func__ << ": Accepted a remote connection.";
|
||||
LOG(INFO) << __func__ << ": Accepted a remote connection.";
|
||||
return std::make_unique<BleV2Socket>(ble_socket);
|
||||
}
|
||||
|
||||
Exception BleV2ServerSocket::Close() {
|
||||
// TODO(b/271031645): implement BLE socket using weave
|
||||
absl::MutexLock lock(&mutex_);
|
||||
NEARBY_LOGS(INFO) << __func__ << ": Close is called.";
|
||||
LOG(INFO) << __func__ << ": Close is called.";
|
||||
|
||||
if (closed_) {
|
||||
return {Exception::kSuccess};
|
||||
@@ -67,7 +69,7 @@ Exception BleV2ServerSocket::Close() {
|
||||
|
||||
bool BleV2ServerSocket::Bind() {
|
||||
// TODO(b/271031645): implement BLE socket using weave
|
||||
NEARBY_LOGS(ERROR) << __func__ << ": GATT socket started.";
|
||||
LOG(ERROR) << __func__ << ": GATT socket started.";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user