diff --git a/connections/clients/windows/listeners_w.h b/connections/clients/windows/listeners_w.h index b1325916..64fb04bd 100644 --- a/connections/clients/windows/listeners_w.h +++ b/connections/clients/windows/listeners_w.h @@ -223,7 +223,7 @@ struct DLL_API DiscoveryListenerW { // Called when a remote endpoint is discovered. // // endpoint_id - The ID of the remote endpoint that was discovered. - // endpoint_info - The info of the remote endpoint representd by ByteArray. + // endpoint_info - The info of the remote endpoint represented by ByteArray. // service_id - The ID of the service advertised by the remote endpoint. EndpointFoundCB endpoint_found_cb = DefaultConstructor; diff --git a/connections/implementation/ble_advertisement.cc b/connections/implementation/ble_advertisement.cc index d016b400..794effd0 100644 --- a/connections/implementation/ble_advertisement.cc +++ b/connections/implementation/ble_advertisement.cc @@ -132,12 +132,12 @@ BleAdvertisement::BleAdvertisement(bool fast_advertisement, break; default: NEARBY_LOG(INFO, - "Cannot deserialize BleAdvertisement: uunsupported V1 PCP %d", + "Cannot deserialize BleAdvertisement: unsupported V1 PCP %d", pcp_); } // The next 3 bytes are supposed to be the service_id_hash if not fast - // advertisment. + // advertisement. if (!fast_advertisement_) service_id_hash_ = base_input_stream.ReadBytes(kServiceIdHashLength); @@ -161,12 +161,12 @@ BleAdvertisement::BleAdvertisement(bool fast_advertisement, fast_advertisement_, expected_endpoint_info_length, endpoint_info_.size()); - // Clear enpoint_id for validity. + // Clear endpoint_id for validity. endpoint_id_.clear(); return; } - // The next 6 bytes are the bluetooth mac address if not fast advertisment. + // The next 6 bytes are the bluetooth mac address if not fast advertisement. if (!fast_advertisement_) { auto bluetooth_mac_address_bytes = base_input_stream.ReadBytes(BluetoothUtils::kBluetoothMacAddressLength); @@ -189,7 +189,7 @@ BleAdvertisement::BleAdvertisement(bool fast_advertisement, "expected uwbAddress size to be %d bytes, got %" PRIu64, expected_uwb_address_length, uwb_address_.size()); - // Clear enpoint_id for validity. + // Clear endpoint_id for validity. endpoint_id_.clear(); return; } diff --git a/connections/implementation/bluetooth_device_name.cc b/connections/implementation/bluetooth_device_name.cc index bb58d0d2..e20c05af 100644 --- a/connections/implementation/bluetooth_device_name.cc +++ b/connections/implementation/bluetooth_device_name.cc @@ -107,7 +107,7 @@ BluetoothDeviceName::BluetoothDeviceName( // The next 3 bytes are supposed to be the service_id_hash. service_id_hash_ = base_input_stream.ReadBytes(kServiceIdHashLength); - // The next 1 byte is field containning WebRtc state. + // The next 1 byte is field containing WebRtc state. auto field_byte = static_cast(base_input_stream.ReadUint8()); web_rtc_state_ = (field_byte & kWebRtcConnectableFlagBitmask) == 1 ? WebRtcState::kConnectable @@ -129,7 +129,7 @@ BluetoothDeviceName::BluetoothDeviceName( "endpoint info to be %d bytes, got %" PRIu64, expected_endpoint_info_length, endpoint_info_.size()); - // Clear enpoint_id for validadity. + // Clear endpoint_id for validity. endpoint_id_.clear(); return; } @@ -150,7 +150,7 @@ BluetoothDeviceName::BluetoothDeviceName( "expected uwbAddress size to be %d bytes, got %" PRIu64, expected_uwb_address_length, uwb_address_.size()); - // Clear enpoint_id for validadity. + // Clear endpoint_id for validity. endpoint_id_.clear(); return; } diff --git a/connections/implementation/mediums/ble.cc b/connections/implementation/mediums/ble.cc index 80eb49c4..38e38491 100644 --- a/connections/implementation/mediums/ble.cc +++ b/connections/implementation/mediums/ble.cc @@ -223,7 +223,7 @@ bool Ble::StopScanning(const std::string& service_id) { MutexLock lock(&mutex_); if (!IsScanningLocked(service_id)) { - NEARBY_LOGS(INFO) << "Can't turn off BLE sacanning because we never " + NEARBY_LOGS(INFO) << "Can't turn off BLE scanning because we never " "started scanning."; return false; } diff --git a/connections/implementation/mediums/bluetooth_classic.h b/connections/implementation/mediums/bluetooth_classic.h index 19a040c8..c845f270 100644 --- a/connections/implementation/mediums/bluetooth_classic.h +++ b/connections/implementation/mediums/bluetooth_classic.h @@ -145,13 +145,13 @@ class BluetoothClassic { // Returns true, if discoverability is enabled with TurnOnDiscoverability(). bool IsDiscoverable() const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - // Assignes a different name to BT adapter. + // Assigns a different name to BT adapter. // Returns true if successful. Stores original device name. bool ModifyDeviceName(const std::string& device_name) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); // Changes current scan mode. This is an implementation of - // TurnDiscoveradility() method. Stores original scan mode. + // TurnDiscoverability() method. Stores original scan mode. bool ModifyScanMode(ScanMode scan_mode) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); // Restores original device name (the one before the very first call to diff --git a/internal/platform/base_pipe.h b/internal/platform/base_pipe.h index 766b2fc5..f36266ba 100644 --- a/internal/platform/base_pipe.h +++ b/internal/platform/base_pipe.h @@ -30,7 +30,7 @@ namespace location { namespace nearby { -// Common Pipe implenentation. +// Common Pipe implementation. // It does not depend on platform implementation, and this allows it to // be used in the platform implementation itself. // Concrete class must be derived from it, as follows: diff --git a/internal/platform/ble_v2.cc b/internal/platform/ble_v2.cc index acf0b4e3..6154e849 100644 --- a/internal/platform/ble_v2.cc +++ b/internal/platform/ble_v2.cc @@ -74,7 +74,7 @@ bool BleV2Medium::StartScanning(const Uuid& service_uuid, // Clear the `peripherals_` after succeeded in StartScanning and before the // advertisement_found callback has been reached. This prevents deleting the // existing `peripherals_` if the scanning is not started successfully. If - // sanning is started successfully, we need to clear `peripherals_` to + // scanning is started successfully, we need to clear `peripherals_` to // prevent the stale data in cache. peripherals_.clear(); scanning_enabled_ = true; diff --git a/internal/platform/ble_v2.h b/internal/platform/ble_v2.h index db9c298e..af123012 100644 --- a/internal/platform/ble_v2.h +++ b/internal/platform/ble_v2.h @@ -57,7 +57,7 @@ class BleV2Socket final { // the BleSocket object is destroyed. OutputStream& GetOutputStream() { return impl_->GetOutputStream(); } - // Sets the close notifier by cient side. + // Sets the close notifier by client side. void SetCloseNotifier(std::function notifier) { close_notifier_ = std::move(notifier); } diff --git a/internal/platform/cancellation_flag.h b/internal/platform/cancellation_flag.h index e861bfe0..f7cc5a34 100644 --- a/internal/platform/cancellation_flag.h +++ b/internal/platform/cancellation_flag.h @@ -51,7 +51,7 @@ class CancellationFlag { // The registration inserts the pointer of caller's listener callback into // `listeners_`, a flat hash set which support the pointer type for hashing // function. It conducts that 2 different pointers might point to the same - // callback function which is unusal and should avoid. Hence we make it as + // callback function which is unusual and should avoid. Hence we make it as // private and use `CancellationFlagListener` as a RAII to wrap the function. // The caller should register listener as lambda or std::function // via `CancellationFlagListener`. diff --git a/internal/platform/exception.h b/internal/platform/exception.h index 4a3e12f7..dbed1ee1 100644 --- a/internal/platform/exception.h +++ b/internal/platform/exception.h @@ -30,7 +30,7 @@ struct Exception { kInterrupted = 2, // Operation was interrupted. kInvalidProtocolBuffer = 3, // Couldn't parse. kExecution = 4, // Couldn't execute. - kTimeout = 5, // Operarion did not finish within specified time. + kTimeout = 5, // Operation did not finish within specified time. kIllegalCharacters = 6, // File name or parent path contained // illegal chars }; @@ -79,7 +79,7 @@ class ExceptionOr { : result_{result}, exception_{Exception::kSuccess} {} // NOLINT ExceptionOr(Exception::Value exception) : exception_{exception} {} // NOLINT ExceptionOr(Exception exception) : exception_{exception} {} // NOLINT - // If there exists explicit conversion from from U to T, + // If there exists explicit conversion from U to T, // then allow explicit conversion from ExceptionOr to ExceptionOr. template ()})>> explicit ExceptionOr(ExceptionOr value) { diff --git a/internal/platform/feature_flags.h b/internal/platform/feature_flags.h index 661289bc..384c8d79 100644 --- a/internal/platform/feature_flags.h +++ b/internal/platform/feature_flags.h @@ -67,7 +67,7 @@ class FeatureFlags { private: FeatureFlags() = default; - // MediumEnvironment is testing uitl class. Use friend class here to enable + // MediumEnvironment is testing util class. Use friend class here to enable // SetFlags for feature controlling need in test environment. friend class MediumEnvironment; void SetFlags(const Flags& flags) ABSL_LOCKS_EXCLUDED(mutex_) { diff --git a/internal/platform/file.h b/internal/platform/file.h index 93be7af3..32ee7336 100644 --- a/internal/platform/file.h +++ b/internal/platform/file.h @@ -49,7 +49,7 @@ class InputFile final { // Returns Exception::kIo on error, or end of file. ExceptionOr Read(std::int64_t size); - // Returns a string that uniqely identifies this file. + // Returns a string that uniquely identifies this file. std::string GetFilePath() const; // Returns total size of this file in bytes. diff --git a/internal/platform/implementation/g3/ble_v2.h b/internal/platform/implementation/g3/ble_v2.h index 8b4becd5..0c692f93 100644 --- a/internal/platform/implementation/g3/ble_v2.h +++ b/internal/platform/implementation/g3/ble_v2.h @@ -196,7 +196,7 @@ class BleV2Medium : public api::ble_v2::BleMedium { BluetoothAdapter& GetAdapter() { return *adapter_; } private: - // A concrete implemenation for GattServer. + // A concrete implementation for GattServer. class GattServer : public api::ble_v2::GattServer { public: std::optional CreateCharacteristic( @@ -213,7 +213,7 @@ class BleV2Medium : public api::ble_v2::BleMedium { void Stop() override; }; - // A concrete implemenation for GattClient. + // A concrete implementation for GattClient. class GattClient : public api::ble_v2::GattClient { public: bool DiscoverServiceAndCharacteristics( diff --git a/internal/platform/implementation/wifi_hotspot.h b/internal/platform/implementation/wifi_hotspot.h index c32ea37d..29b519ca 100644 --- a/internal/platform/implementation/wifi_hotspot.h +++ b/internal/platform/implementation/wifi_hotspot.h @@ -95,7 +95,7 @@ class WifiHotspotMedium { int port) = 0; // Start a softAP as Hotspot with platform dependent APIs and set the - // SSID/password pair back to the credentials. BWU module will retieve these + // SSID/password pair back to the credentials. BWU module will retrieve these // credentials and send to the client device through established channel and // then client may connect to this Hotspot with these credentials. virtual bool StartWifiHotspot(HotspotCredentials* hotspot_credentials) = 0; diff --git a/internal/platform/implementation/windows/ble_v2.cc b/internal/platform/implementation/windows/ble_v2.cc index 3c149e03..50d7792d 100644 --- a/internal/platform/implementation/windows/ble_v2.cc +++ b/internal/platform/implementation/windows/ble_v2.cc @@ -203,7 +203,7 @@ bool BleV2Medium::StartScanning(const Uuid& service_uuid, advertisement_received_token_ = watcher_.Received({this, &BleV2Medium::AdvertisementReceivedHandler}); - // Active mode indicates that scan request packes will be sent to query for + // Active mode indicates that scan request packets will be sent to query for // Scan Response watcher_.ScanningMode(BluetoothLEScanningMode::Active); watcher_.Start(); diff --git a/internal/platform/implementation/windows/bluetooth_classic_device.h b/internal/platform/implementation/windows/bluetooth_classic_device.h index 21362ebd..bce65c88 100644 --- a/internal/platform/implementation/windows/bluetooth_classic_device.h +++ b/internal/platform/implementation/windows/bluetooth_classic_device.h @@ -36,7 +36,7 @@ namespace windows { // https://docs.microsoft.com/en-us/uwp/api/windows.foundation.iasyncoperation-1?view=winrt-20348 using winrt::Windows::Foundation::IAsyncOperation; -// The result of an Rfcomm device service request. +// The result of a Rfcomm device service request. // https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.rfcomm.rfcommdeviceservicesresult?view=winrt-20348 using winrt::Windows::Devices::Bluetooth::Rfcomm::RfcommDeviceServicesResult; diff --git a/internal/platform/implementation/windows/wifi.h b/internal/platform/implementation/windows/wifi.h index f31d68f8..e4b8cd22 100644 --- a/internal/platform/implementation/windows/wifi.h +++ b/internal/platform/implementation/windows/wifi.h @@ -115,7 +115,7 @@ class WifiMedium : public api::WifiMedium { private: // Since the WiFi interface capability won't change in the connection session, - // we only need to querry it once at the beginning + // we only need to query it once at the beginning void InitCapability(); bool wifi_interface_valid_; diff --git a/internal/platform/implementation/windows/wifi_hotspot.h b/internal/platform/implementation/windows/wifi_hotspot.h index 69ea6921..b3076e4e 100644 --- a/internal/platform/implementation/windows/wifi_hotspot.h +++ b/internal/platform/implementation/windows/wifi_hotspot.h @@ -229,7 +229,7 @@ class WifiHotspotMedium : public api::WifiHotspotMedium { std::unique_ptr ListenForService( int port) override; - // Advertiser start WiFi Hotspot with specific Crendentials + // Advertiser start WiFi Hotspot with specific Credentials. bool StartWifiHotspot(HotspotCredentials* hotspot_credentials_) override; // Advertiser stop the current WiFi Hotspot bool StopWifiHotspot() override; diff --git a/internal/platform/medium_environment.h b/internal/platform/medium_environment.h index b0e51b3a..399dbe06 100644 --- a/internal/platform/medium_environment.h +++ b/internal/platform/medium_environment.h @@ -104,7 +104,7 @@ class MediumEnvironment { // If enabled_notifications is false, future event notifications will not be // sent to registered instances. This is useful for protocol shutdown, // where we no longer care about notifications, and where notifications may - // otherwise be delivered after the notification source or target lifeteme has + // otherwise be delivered after the notification source or target lifetime has // ended, and cause undefined behavior. void Sync(bool enable_notifications = true); @@ -116,7 +116,7 @@ class MediumEnvironment { api::BluetoothAdapter::ScanMode mode); // Adds medium-related info to allow for adapter discovery to work. - // This provides acccess to this medium from other mediums, when protocol + // This provides access to this medium from other mediums, when protocol // expects they should communicate. void RegisterBluetoothMedium(api::BluetoothClassicMedium& medium, api::BluetoothAdapter& medium_adapter); @@ -169,7 +169,7 @@ class MediumEnvironment { absl::Duration GetPeerConnectionLatency(); // Adds medium-related info to allow for scanning/advertising to work. - // This provides acccess to this medium from other mediums, when protocol + // This provides access to this medium from other mediums, when protocol // expects they should communicate. void RegisterBleMedium(api::BleMedium& medium); @@ -209,7 +209,7 @@ class MediumEnvironment { const std::string& service_id); // Adds medium-related info to allow for scanning/advertising to work. - // This provides acccess to this medium from other mediums, when protocol + // This provides access to this medium from other mediums, when protocol // expects they should communicate. // The registered `medium` must refer to a valid instance that outlives this // object. @@ -262,7 +262,7 @@ class MediumEnvironment { void UnregisterBleV2Medium(api::ble_v2::BleMedium& mediumum); // Adds medium-related info to allow for discovery/advertising to work. - // This provides acccess to this medium from other mediums, when protocol + // This provides access to this medium from other mediums, when protocol // expects they should communicate. void RegisterWifiLanMedium(api::WifiLanMedium& medium); @@ -295,7 +295,7 @@ class MediumEnvironment { api::WifiLanMedium* GetWifiLanMedium(const std::string& ip_address, int port); // Adds medium-related info to allow for start/connect Hotspot to work. - // This provides acccess to this medium from other mediums, when protocol + // This provides access to this medium from other mediums, when protocol // expects they should communicate. void RegisterWifiHotspotMedium(api::WifiHotspotMedium& medium); diff --git a/internal/platform/wifi_hotspot.h b/internal/platform/wifi_hotspot.h index 1f8767e3..dda86dc7 100644 --- a/internal/platform/wifi_hotspot.h +++ b/internal/platform/wifi_hotspot.h @@ -96,7 +96,7 @@ class WifiHotspotSocket final { std::shared_ptr impl_; }; -// Server socket class for SoftAP when it listen to connection request +// Server socket class for SoftAP when it listens to connection request. class WifiHotspotServerSocket final { public: WifiHotspotServerSocket() = default; diff --git a/internal/platform/wifi_lan.h b/internal/platform/wifi_lan.h index ff0c609f..d93ad452 100644 --- a/internal/platform/wifi_lan.h +++ b/internal/platform/wifi_lan.h @@ -198,7 +198,7 @@ class WifiLanMedium { // this Medium if (impl_ == nullptr) return false; // A network connection to a primary router exist, also implied that HW is - // exist and enabled + // existed and enabled. return impl_->IsNetworkConnected(); }