-
Notifications
You must be signed in to change notification settings - Fork 0
Add TCK compatibility test results in README #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Eclipse™ Sparkplug™ TCK (Test Compatibility Kit) compatibility test results to the README and implements supporting functionality to enable TCK testing. The changes include adding scan rate command support, introducing a profile-based configuration system, and enhancing the host application's subscription management.
Key Changes:
- Added TCK compatibility test results table to README showing 5 passed tests and 1 unsupported feature
- Implemented scan rate command functionality for both Edge Nodes and Devices
- Introduced profile-based configuration system (IProfile interface with TCK and MIMIC implementations) to support different deployment scenarios
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Added TCK compatibility test results section with test status table |
| SparkplugHostApplication.cs | Enhanced logging with MQTT client ID, improved subscription management to support wildcard topics |
| SparkplugHostApplicationExtensions.cs | Added PublishEdgeNodeScanRateCommandAsync and PublishDeviceScanRateCommandAsync methods with validation |
| SparkplugClientOptions.cs | Added AlwaysSubscribeToWildcardTopic property to support TCK test requirements |
| Program.cs | Refactored to use profile-based configuration with command-line argument support |
| SimpleHostApplication.cs | Extended SendCommandAsync to support both Rebirth and ScanRate command types |
| IProfile.cs | New interface defining contract for configuration profiles |
| TckApplicationProfile.cs | New profile for TCK testing with localhost broker configuration |
| MimicApplicationProfile.cs | New profile for MIMIC simulator with HiveMQ broker configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (scanRate <= 0) | ||
| throw new ArgumentOutOfRangeException(nameof(scanRate), scanRate, "Scan rate must be greater than zero."); | ||
|
|
||
| var payload = CreateScanRatePayload(true, scanRate); | ||
| return hostApplication.PublishEdgeNodeCommandMessageAsync(groupId, edgeNodeId, payload); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Sends a Scan Rate command to a specific Device | ||
| /// </summary> | ||
| /// <param name="hostApplication">The Sparkplug Host Application instance</param> | ||
| /// <param name="groupId">The Sparkplug Group ID</param> | ||
| /// <param name="edgeNodeId">The Sparkplug Edge Node ID</param> | ||
| /// <param name="deviceId">The Sparkplug Device ID</param> | ||
| /// <param name="scanRate">The scan rate value in milliseconds</param> | ||
| /// <returns>The MQTT Client Publish Result</returns> | ||
| public static Task<MqttClientPublishResult> PublishDeviceScanRateCommandAsync( | ||
| this SparkplugHostApplication hostApplication, string groupId, string edgeNodeId, string deviceId, | ||
| long scanRate) | ||
| { | ||
| ArgumentNullException.ThrowIfNull(hostApplication); | ||
| SparkplugNamespace.ValidateNamespaceElement(groupId, nameof(groupId)); | ||
| SparkplugNamespace.ValidateNamespaceElement(edgeNodeId, nameof(edgeNodeId)); | ||
| SparkplugNamespace.ValidateNamespaceElement(deviceId, nameof(deviceId)); | ||
| if (scanRate <= 0) | ||
| throw new ArgumentOutOfRangeException(nameof(scanRate), scanRate, "Scan rate must be greater than zero."); |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The scan rate validation logic if (scanRate <= 0) throw new ArgumentOutOfRangeException(...) is duplicated in both PublishEdgeNodeScanRateCommandAsync (lines 64-65) and PublishDeviceScanRateCommandAsync (lines 88-89). Consider extracting this validation into a private helper method to reduce code duplication and ensure consistency.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Updated README to add TCK compatibility test results in table format.