mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
These are the fixes thus far. Most involve whether we're using a pointer or not.
PiperOrigin-RevId: 401241518
This commit is contained in:
committed by
Copybara-Service
parent
dceb1e216b
commit
eea2a91139
@@ -60,7 +60,9 @@ void BluetoothClassicMedium::OnScanModeChanged(
|
||||
bool radioDiscoverable = bluetooth_adapter_.GetScanMode() ==
|
||||
BluetoothAdapter::ScanMode::kConnectableDiscoverable;
|
||||
|
||||
bluetooth_server_socket_->SetScanMode(radioDiscoverable);
|
||||
if (bluetooth_server_socket_ != nullptr) {
|
||||
bluetooth_server_socket_->SetScanMode(radioDiscoverable);
|
||||
}
|
||||
}
|
||||
|
||||
bool BluetoothClassicMedium::StartDiscovery(
|
||||
@@ -251,14 +253,14 @@ bool BluetoothClassicMedium::CheckSdp(RfcommDeviceService requestedService) {
|
||||
// Do various checks of the SDP record to make sure you are talking to a
|
||||
// device that actually supports the Bluetooth Rfcomm Service
|
||||
// https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.rfcomm.rfcommdeviceservice.getsdprawattributesasync?view=winrt-20348
|
||||
auto attributes = /*await*/ requestedService.GetSdpRawAttributesAsync();
|
||||
if (!attributes.get().HasKey(Constants::SdpServiceNameAttributeId)) {
|
||||
auto attributes = requestedService.GetSdpRawAttributesAsync().get();
|
||||
if (!attributes.HasKey(Constants::SdpServiceNameAttributeId)) {
|
||||
NEARBY_LOGS(ERROR) << __func__ << ": Missing SdpServiceNameAttributeId.";
|
||||
return false;
|
||||
}
|
||||
|
||||
auto attributeReader = DataReader::FromBuffer(
|
||||
attributes.get().Lookup(Constants::SdpServiceNameAttributeId));
|
||||
attributes.Lookup(Constants::SdpServiceNameAttributeId));
|
||||
|
||||
auto attributeType = attributeReader.ReadByte();
|
||||
|
||||
@@ -374,7 +376,7 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Added(
|
||||
EnterCriticalSection(&critical_section_);
|
||||
|
||||
std::unique_ptr<BluetoothDevice> bluetoothDevice =
|
||||
std::make_unique<BluetoothDevice>(async.GetResults());
|
||||
std::make_unique<BluetoothDevice>(async.get());
|
||||
|
||||
devices_by_id_[deviceInfo.Id()] = std::move(bluetoothDevice);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user