Turn on auto_upgrade_bandwidth as default.

PiperOrigin-RevId: 456586628
This commit is contained in:
hai007
2022-06-22 12:58:14 -07:00
committed by Copybara-Service
parent cfa9e555c7
commit 7046d24dfe
6 changed files with 147 additions and 147 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ namespace connections {
// Connection Options: used for both Advertising and Discovery.
// All fields are mutable, to make the type copy-assignable.
struct AdvertisingOptions : public OptionsBase {
bool auto_upgrade_bandwidth;
bool auto_upgrade_bandwidth = true;
bool enforce_topology_constraints;
bool low_power;
bool enable_bluetooth_listening;
@@ -1,44 +1,44 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_ADVERTISING_OPTIONS_W_H_
#define THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_ADVERTISING_OPTIONS_W_H_
#include "connections/clients/windows/options_base_w.h"
namespace location::nearby::windows {
extern "C" {
// Advertising Options: used for Advertising.
// All fields are mutable, to make the type copy-assignable.
struct DLL_API AdvertisingOptionsW : public OptionsBaseW {
bool auto_upgrade_bandwidth;
bool enforce_topology_constraints;
bool low_power;
// Whether this is intended to be used in conjunction with InjectEndpoint().
bool is_out_of_band_connection = false;
const char* fast_advertisement_service_uuid;
// Returns a copy and normalizes allowed mediums:
// (1) If is_out_of_band_connection is true, verifies that there is only one
// medium allowed, defaulting to only Bluetooth if unspecified.
// (2) If no mediums are allowed, allow all mediums.
AdvertisingOptionsW CompatibleOptions() const;
};
} // extern "C"
} // namespace location::nearby::windows
#endif // THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_ADVERTISING_OPTIONS_W_H_
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_ADVERTISING_OPTIONS_W_H_
#define THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_ADVERTISING_OPTIONS_W_H_
#include "connections/clients/windows/options_base_w.h"
namespace location::nearby::windows {
extern "C" {
// Advertising Options: used for Advertising.
// All fields are mutable, to make the type copy-assignable.
struct DLL_API AdvertisingOptionsW : public OptionsBaseW {
bool auto_upgrade_bandwidth = true;
bool enforce_topology_constraints;
bool low_power;
// Whether this is intended to be used in conjunction with InjectEndpoint().
bool is_out_of_band_connection = false;
const char* fast_advertisement_service_uuid;
// Returns a copy and normalizes allowed mediums:
// (1) If is_out_of_band_connection is true, verifies that there is only one
// medium allowed, defaulting to only Bluetooth if unspecified.
// (2) If no mediums are allowed, allow all mediums.
AdvertisingOptionsW CompatibleOptions() const;
};
} // extern "C"
} // namespace location::nearby::windows
#endif // THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_ADVERTISING_OPTIONS_W_H_
@@ -1,54 +1,54 @@
// Copyright 2021-2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_CONNECTION_OPTIONS_W_H_
#define THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_CONNECTION_OPTIONS_W_H_
#include <string>
#include "connections/clients/windows/medium_selector_w.h"
#include "connections/clients/windows/options_base_w.h"
namespace location::nearby::windows {
extern "C" {
#define MAX_MEDIUMS 5
// Feature On/Off switch for mediums.
using BooleanMediumSelector = MediumSelectorW<bool>;
// Connection Options: used for both Advertising and Discovery.
// All fields are mutable, to make the type copy-assignable.
struct DLL_API ConnectionOptionsW : public OptionsBaseW {
bool auto_upgrade_bandwidth;
bool enforce_topology_constraints;
bool low_power;
// Whether this is intended to be used in conjunction with InjectEndpoint().
bool is_out_of_band_connection = false;
const char* remote_bluetooth_mac_address;
const char* fast_advertisement_service_uuid;
int keep_alive_interval_millis = 0;
int keep_alive_timeout_millis = 0;
void GetMediums(const MediumW*, size_t) const;
private:
MediumW* mediums_[MAX_MEDIUMS];
size_t mediums_size;
};
} // extern "C"
} // namespace location::nearby::windows
#endif // THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_CONNECTION_OPTIONS_W_H_
// Copyright 2021-2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_CONNECTION_OPTIONS_W_H_
#define THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_CONNECTION_OPTIONS_W_H_
#include <string>
#include "connections/clients/windows/medium_selector_w.h"
#include "connections/clients/windows/options_base_w.h"
namespace location::nearby::windows {
extern "C" {
#define MAX_MEDIUMS 5
// Feature On/Off switch for mediums.
using BooleanMediumSelector = MediumSelectorW<bool>;
// Connection Options: used for both Advertising and Discovery.
// All fields are mutable, to make the type copy-assignable.
struct DLL_API ConnectionOptionsW : public OptionsBaseW {
bool auto_upgrade_bandwidth = true;
bool enforce_topology_constraints;
bool low_power;
// Whether this is intended to be used in conjunction with InjectEndpoint().
bool is_out_of_band_connection = false;
const char* remote_bluetooth_mac_address;
const char* fast_advertisement_service_uuid;
int keep_alive_interval_millis = 0;
int keep_alive_timeout_millis = 0;
void GetMediums(const MediumW*, size_t) const;
private:
MediumW* mediums_[MAX_MEDIUMS];
size_t mediums_size;
};
} // extern "C"
} // namespace location::nearby::windows
#endif // THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_CONNECTION_OPTIONS_W_H_
@@ -1,46 +1,46 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_DISCOVERY_OPTIONS_W_H_
#define THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_DISCOVERY_OPTIONS_W_H_
#include <string>
#include "connections/clients/windows/options_base_w.h"
namespace location::nearby::windows {
extern "C" {
// Connection Options: used for both Advertising and Discovery.
// All fields are mutable, to make the type copy-assignable.
struct DLL_API DiscoveryOptionsW : public OptionsBaseW {
bool auto_upgrade_bandwidth;
bool enforce_topology_constraints;
int keep_alive_interval_millis = 0;
int keep_alive_timeout_millis = 0;
// Whether this is intended to be used in conjunction with InjectEndpoint().
bool is_out_of_band_connection = false;
const char* fast_advertisement_service_uuid;
// Returns a copy and normalizes allowed mediums:
// (1) If is_out_of_band_connection is true, verifies that there is only one
// medium allowed, defaulting to only Bluetooth if unspecified.
// (2) If no mediums are allowed, allow all mediums.
DiscoveryOptionsW CompatibleOptions() const;
};
} // extern "C"
} // namespace location::nearby::windows
#endif // THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_DISCOVERY_OPTIONS_W_H_
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_DISCOVERY_OPTIONS_W_H_
#define THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_DISCOVERY_OPTIONS_W_H_
#include <string>
#include "connections/clients/windows/options_base_w.h"
namespace location::nearby::windows {
extern "C" {
// Connection Options: used for both Advertising and Discovery.
// All fields are mutable, to make the type copy-assignable.
struct DLL_API DiscoveryOptionsW : public OptionsBaseW {
bool auto_upgrade_bandwidth = true;
bool enforce_topology_constraints;
int keep_alive_interval_millis = 0;
int keep_alive_timeout_millis = 0;
// Whether this is intended to be used in conjunction with InjectEndpoint().
bool is_out_of_band_connection = false;
const char* fast_advertisement_service_uuid;
// Returns a copy and normalizes allowed mediums:
// (1) If is_out_of_band_connection is true, verifies that there is only one
// medium allowed, defaulting to only Bluetooth if unspecified.
// (2) If no mediums are allowed, allow all mediums.
DiscoveryOptionsW CompatibleOptions() const;
};
} // extern "C"
} // namespace location::nearby::windows
#endif // THIRD_PARTY_NEARBY_CONNECTIONS_CLIENTS_WINDOWS_DISCOVERY_OPTIONS_W_H_
+1 -1
View File
@@ -26,7 +26,7 @@ namespace connections {
// Connection Options: used for both Advertising and Discovery.
// All fields are mutable, to make the type copy-assignable.
struct ConnectionOptions : public OptionsBase {
bool auto_upgrade_bandwidth;
bool auto_upgrade_bandwidth = true;
bool enforce_topology_constraints;
bool low_power;
bool enable_bluetooth_listening;
+1 -1
View File
@@ -35,7 +35,7 @@ struct DiscoveryOptions : OptionsBase {
// (2) If no mediums are allowed, allow all mediums.
DiscoveryOptions CompatibleOptions() const;
bool auto_upgrade_bandwidth;
bool auto_upgrade_bandwidth = true;
bool enforce_topology_constraints;
int keep_alive_interval_millis = 0;
int keep_alive_timeout_millis = 0;