Skip to content
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

NCMD Event only receive single metric #73

Closed
adityashahazilen opened this issue Feb 26, 2024 · 2 comments
Closed

NCMD Event only receive single metric #73

adityashahazilen opened this issue Feb 26, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@adityashahazilen
Copy link
Contributor

As per Sparkplug specification "Multiple metrics can be supplied in a single NCMD message". This means when Host Application publish NCMD with multiple metrics then Edge Node should receive all metrics in the single event. At the moment, NodeCommandReceived event only receive single metrics as a argument.

Existing Code
image

It should be like below to handle multiple metrics
image

@adityashahazilen adityashahazilen changed the title NCDM Event only support single metric NCMD Event only receive single metric Feb 26, 2024
@shouidar
Copy link
Contributor

The SparkPlugNode rises an event for each Metric received in the NCMD message:

case SparkplugMessageType.NodeCommand:
                    foreach (var metric in convertedPayloadVersionB.Metrics)
                    {
                        if (metric is VersionBData.Metric convertedMetric)
                        {
                            await this.FireNodeCommandReceivedAsync(convertedMetric);
                        }
                    }

                    break;

But I do prefer the idea of a single event with all the metrics.

@SeppPenner SeppPenner self-assigned this Feb 29, 2024
@SeppPenner SeppPenner added the enhancement New feature or request label Feb 29, 2024
@SeppPenner
Copy link
Owner

I guess, we can do that. Seems legit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants