mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Internal cleanup
PiperOrigin-RevId: 604442644
This commit is contained in:
committed by
Copybara-Service
parent
e706703def
commit
17a71c8b7e
@@ -43,26 +43,6 @@ bool BleV2Medium::StartAdvertising(
|
||||
|
||||
bool BleV2Medium::StopAdvertising() { return impl_->StopAdvertising(); }
|
||||
|
||||
std::unique_ptr<api::ble_v2::BleMedium::AdvertisingSession>
|
||||
BleV2Medium::StartAdvertisingTmp(
|
||||
const api::ble_v2::BleAdvertisementData& advertising_data,
|
||||
api::ble_v2::AdvertiseParameters advertise_set_parameters,
|
||||
api::ble_v2::BleMedium::AdvertisingCallback callback) {
|
||||
if (impl_->StartAdvertising(advertising_data, advertise_set_parameters)) {
|
||||
callback.start_advertising_result(absl::OkStatus());
|
||||
} else {
|
||||
callback.start_advertising_result(
|
||||
absl::InternalError("Failed to start advertising"));
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_unique<api::ble_v2::BleMedium::AdvertisingSession>(
|
||||
api::ble_v2::BleMedium::AdvertisingSession{.stop_advertising = [this] {
|
||||
return impl_->StopAdvertising()
|
||||
? absl::OkStatus()
|
||||
: absl::InternalError("Failed to stop advertising");
|
||||
}});
|
||||
}
|
||||
|
||||
std::unique_ptr<api::ble_v2::BleMedium::AdvertisingSession>
|
||||
BleV2Medium::StartAdvertising(
|
||||
const api::ble_v2::BleAdvertisementData& advertising_data,
|
||||
|
||||
@@ -375,7 +375,7 @@ class BleV2Medium final {
|
||||
// Returns true once the BLE advertising has been initiated.
|
||||
// This interface will be deprecated soon.
|
||||
// TODO(b/271305977) remove this function.
|
||||
// Use 'unique_ptr<AdvertisingSession> StartAdvertisingTmp' instead.
|
||||
// Use 'unique_ptr<AdvertisingSession> StartAdvertising' instead.
|
||||
bool StartAdvertising(
|
||||
const api::ble_v2::BleAdvertisementData& advertising_data,
|
||||
api::ble_v2::AdvertiseParameters advertise_parameters);
|
||||
@@ -383,14 +383,6 @@ class BleV2Medium final {
|
||||
// TODO(b/271305977) remove this function.
|
||||
bool StopAdvertising();
|
||||
|
||||
// Temp interface for windows client to use before windows has native impl
|
||||
// for 'unique_ptr<AdvertisingSession> StartAdvertising'.
|
||||
// TODO(b/271305977) remove this function.
|
||||
std::unique_ptr<api::ble_v2::BleMedium::AdvertisingSession>
|
||||
StartAdvertisingTmp(const api::ble_v2::BleAdvertisementData& advertising_data,
|
||||
api::ble_v2::AdvertiseParameters advertise_set_parameters,
|
||||
api::ble_v2::BleMedium::AdvertisingCallback callback);
|
||||
|
||||
std::unique_ptr<api::ble_v2::BleMedium::AdvertisingSession> StartAdvertising(
|
||||
const api::ble_v2::BleAdvertisementData& advertising_data,
|
||||
api::ble_v2::AdvertiseParameters advertise_set_parameters,
|
||||
|
||||
Reference in New Issue
Block a user