Skip to content

Commit

Permalink
Merge pull request dotnet-bluetooth-le#844 from janusw/windows_update…
Browse files Browse the repository at this point in the history
…Rssi

fix Device.UpdateRssiAsync on Windows
  • Loading branch information
janusw authored May 5, 2024
2 parents 04a5d27 + c22529a commit 3525524
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions Source/Plugin.BLE/Shared/Contracts/IDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface IDevice : IDisposable
string Name { get; }

/// <summary>
/// Last known rssi value in decibals.
/// Last known RSSI value in decibels.
/// Can be updated via <see cref="UpdateRssiAsync()"/>.
/// </summary>
int Rssi { get; }
Expand Down Expand Up @@ -67,15 +67,15 @@ public interface IDevice : IDisposable
Task<IService> GetServiceAsync(Guid id, CancellationToken cancellationToken = default);

/// <summary>
/// Updates the rssi value.
/// Updates the RSSI value.
/// </summary>
/// <remarks>
/// Important:
/// On Android: This function will only work if the device is connected. The Rssi value will be determined once on the discovery of the device.
/// This method is only supported on Android, iOS and MacOS, but not on Windows.
/// On Android: This function will only work if the device is connected. The RSSI value will be determined once on the discovery of the device.
/// </remarks>
/// <returns>
/// A task that represents the asynchronous read operation. The Result property will contain a boolean that inticates if the update was successful.
/// The Task will finish after Rssi has been updated.
/// A task that represents the asynchronous read operation. The Result property will contain a boolean that indicates if the update was successful.
/// The Task will finish after the RSSI has been updated.
/// </returns>
Task<bool> UpdateRssiAsync();

Expand Down
2 changes: 1 addition & 1 deletion Source/Plugin.BLE/Windows/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public override Task<bool> UpdateRssiAsync()

Trace.Message("Request RSSI not supported in Windows");

return Task.FromResult(true);
return Task.FromResult(false);
}

public void DisposeNativeDevice()
Expand Down

0 comments on commit 3525524

Please sign in to comment.