diff --git a/connections/advertising_options.h b/connections/advertising_options.h index 34d39295..8ea3ba09 100644 --- a/connections/advertising_options.h +++ b/connections/advertising_options.h @@ -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; diff --git a/connections/clients/windows/advertising_options_w.h b/connections/clients/windows/advertising_options_w.h index 7328df5b..d02357e0 100644 --- a/connections/clients/windows/advertising_options_w.h +++ b/connections/clients/windows/advertising_options_w.h @@ -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_ diff --git a/connections/clients/windows/connection_options_w.h b/connections/clients/windows/connection_options_w.h index 8f25c537..753662f0 100644 --- a/connections/clients/windows/connection_options_w.h +++ b/connections/clients/windows/connection_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 - -#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; - -// 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 + +#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; + +// 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_ diff --git a/connections/clients/windows/discovery_options_w.h b/connections/clients/windows/discovery_options_w.h index c847b731..a52459f4 100644 --- a/connections/clients/windows/discovery_options_w.h +++ b/connections/clients/windows/discovery_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 - -#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 + +#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_ diff --git a/connections/connection_options.h b/connections/connection_options.h index 35f5b441..ccb63c65 100644 --- a/connections/connection_options.h +++ b/connections/connection_options.h @@ -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; diff --git a/connections/discovery_options.h b/connections/discovery_options.h index 1f5ae108..18e8402d 100644 --- a/connections/discovery_options.h +++ b/connections/discovery_options.h @@ -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;