You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove Dispose call in critical log scenario
The line `Dispose(); // clear the channels` was removed from the method where a critical log message is generated if `ChannelId` is null. This change ensures that the code will no longer call the `Dispose` method to clear the channels in this scenario.
* Refactor AntDeviceCollection and add SendMessageChannel
- Made `AntDeviceCollection` a partial class.
- Added `_sendMessageChannel` field to `AntDeviceCollection`.
- Simplified `AntDeviceCollection` constructor by removing async initialization.
- Added `StartScanning` method to initialize ANT radio and channels.
- Renamed `Channel_ChannelResponse` to `MessageHandler` and updated it.
- Refactored `CreateAntDevice` to use `_sendMessageChannel`.
- Updated `AntPlus.csproj` to version `5.0.0.0`.
- Added `SendMessageChannel` class to manage multiple ANT channels.
- Implemented async data sending and channel management in `SendMessageChannel`.
* Refactor tests and add new logging verifications
Refactored test classes to use mock loggers and updated test methods to be asynchronous. Added new tests for logging critical messages and warnings. Introduced a new `SendMessageChannelTests` class to verify `NotImplementedException` and concurrent method invocations.
* Add release notes and documentation for versions 5.0.0.0 and 1.1.1.0
Updated `AntPlus.csproj` to include new package release notes indicating breaking changes. The `AntDeviceCollection` constructor no longer initiates ANT device scanning; `StartScanning` must be called after instantiation.
Updated `AntPllusVersionHistory.aml` and `HostingExtensionsVersionHistory.aml` to include new list items with links to the new version history.
Updated `ContentLayout.content` to add new topics for versions 5.0.0.0 and 1.1.1.0, marking version 5.0.0.0 as selected.
Updated `Documentation.shfbproj` to re-add namespace summary items and include new entries for the version history files for versions 5.0.0.0 and 1.1.1.0.
Added new files `v5.0.0.0.aml` and `v1.1.1.0.aml` detailing the releases, including breaking changes, improvements, and a fix for a potential race condition.
* Remove ackWaitTime parameter and standardize timeouts
The changes primarily involve the removal of the `ackWaitTime` parameter from various method calls and method signatures. This parameter, which specified the time in milliseconds to wait for device acknowledgment, has been replaced with `It.IsAny<uint>()` in the unit tests and with a default timeout value `_deviceTimeout` in the main code.
In the unit tests within `TrainerStationaryBikeTests.cs`, the hardcoded `500` milliseconds wait time has been replaced with `It.IsAny<uint>()` to make the tests more flexible and less dependent on specific timeout values.
In the `AntDevice.cs` file, the `ackWaitTime` parameter has been removed from the `RequestDataPage` and `SendExtAcknowledgedMessage` methods. Instead, these methods now use the `_deviceTimeout` field to determine the timeout duration.
Similar changes have been made in the `Tracker.cs`, `Parameters.cs`, and `Geocache.cs` files, where the `ackWaitTime` parameter has been removed from method calls and replaced with the default timeout value.
These changes aim to standardize the timeout handling across the codebase, making it more maintainable and consistent.
* Update tests and refactor Geocache functionality
Updated NuGet packages in AntPlus.UnitTests.csproj:
- Microsoft.NET.Test.Sdk to 17.13.0
- MSTest.TestAdapter to 3.7.3
- MSTest.TestFramework to 3.7.3
- coverlet.collector to 6.0.4
GeocacheTests.cs changes:
- mockAntChannel now uses MockBehavior.Loose
- Added tests: EraseGeocache_Success_ReturnsPass and EraseGeocache_Failure_ReturnsError
Geocache.cs changes:
- Refactored ProgramGeocache method: pin is no longer nullable, uses ClearGeocacheState helper, streamlined message assembly, added logging
- Added ClearGeocacheState private method
- Added EraseGeocache public method with detailed logging
* Examples Update - Add EraseGeocacheCommand and related functionality
- Added EraseGeocacheCommand to GeocacheViewModel in MauiAntGrpcClient and WpfUsbStickApp namespaces.
- Introduced EraseGeocache method in GeocacheViewModel to handle geocache erasure.
- Added CanEraseGeocache method to determine if EraseGeocacheCommand can be executed.
- Updated ProgramGeocacheView.xaml and GeocacheWindow.xaml to include buttons for erasing geocaches.
- Changed pin property type from uint? to uint in GeocacheViewModel.
- Added NotifyCanExecuteChangedFor attribute to isBusy property.
* Refactor geocache logic and improve logging
- Updated `EraseGeocache` test in `GeocacheTests.cs` to verify specific byte arrays.
- Removed retry logic in `SendExtAcknowledgedMessage` in `AntDevice.cs`; now logs a warning on failure.
- Refactored `RequestPinPage` in `Geocache.cs` to use new `ClearGeocacheState` method.
- Corrected typo in exception message in `UpdateLoggedVisits` in `Geocache.cs`.
- Updated logging in `ProgramGeocache` and `EraseGeocache` in `Geocache.cs` to use structured logging.
* Refactor methods and update logging in Ant classes
Renamed private methods and updated logging statements in the
AntChannel and AntRadio classes within the SmallEarthTech.AntUsbStick
namespace. Specifically:
- In AntChannel.cs:
- Renamed Channel_ChannelResponse to OnChannelResponse.
- Renamed Channel_DeviceNotification to OnDeviceNotification.
- Changed logging level for OnChannelResponse from LogDebug to LogTrace.
- Updated logging statements to use structured logging with named placeholders.
- In AntRadio.cs:
- Renamed AntDevice_deviceResponse to OnDeviceResponse.
- Renamed AntDevice_SerialError to OnAntDeviceSerialError.
- Updated logging statements to use structured logging with named placeholders.
Updated AntUsbStick.csproj to upgrade Microsoft.Extensions.Logging.Abstractions
package from version 8.0.2 to 9.0.2.
* Clean up logging in various projects.
* Clean up logging.
* Project file updates for hosting and USB stick.
* Updated documentation project content.
Copy file name to clipboardexpand all lines: AntPlus.Extensions.Hosting/Hosting.csproj
+4
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@
12
12
<Description>Useful ANT+ extensions for hosting in DI containers. Simple and easy to use! Includes support for .NET MAUI and Windows apps.</Description>
<PackageReleaseNotes>Fixed potential race condition sending multiple messages to multiple ANT devices managed by the AntCollection class.</PackageReleaseNotes>
Copy file name to clipboardexpand all lines: AntPlus.Extensions.Hosting/SendMessageChannel.cs
+1-2
Original file line number
Diff line number
Diff line change
@@ -85,11 +85,10 @@ public Task<MessagingReturnCode> SendExtAcknowledgedDataAsync(ChannelId channelI
85
85
.ContinueWith(antecedent =>
86
86
{
87
87
intindex=antecedent.Result;
88
-
_logger.LogDebug("SendExtAcknowledgedDataAsync: Invoke. Task ID = {TaskId}, channel index = {ChannelIndex}, channel ID = 0x{ChannelId:X8}",antecedent.Id,index,channelId.Id);
88
+
_logger.LogDebug("SendExtAcknowledgedDataAsync: channel index = {ChannelIndex}, channel ID = 0x{ChannelId:X8}, data = {Data}",index,channelId.Id,BitConverter.ToString(data));
_logger.LogDebug("SendExtAcknowledgedDataAsync: Completed. Task ID = {TaskId}, channel index = {ChannelIndex}, channel ID = 0x{ChannelId:X8}",antecedent.Id,index,channelId.Id);
93
92
lock(_channelLock)
94
93
{
95
94
// release the channel and notify this channel is available
0 commit comments