Skip to content

SparkplugTopicGenerator not generating correct STATE topic for Node subscription #121

@VindNN

Description

@VindNN

On startup, Primary application correctly publishes it's state to 'spBv1.0/STATE/SparkplugNet'.
However, Node only subscribes to 'STATE/SparkplugNet', missing the SparkplugNamespace:

/// <summary>
/// Gets state subscription topic.
/// </summary>
/// <param name="scadaHostIdentifier">The SCADA host identifier.</param>
/// <returns>The state subscription topic <see cref="string"/>.</returns>
internal static string GetStateSubscribeTopic(string scadaHostIdentifier)
{
    return $"{SparkplugMessageType.StateMessage.GetDescription()}/{scadaHostIdentifier}";
}

This means that Nodes never receive STATE messages from the Primary application.

As an example, command subscription correctly prepends the namespace:

/// <summary>
/// Gets the node command subscription topic.
/// </summary>
/// <param name="nameSpace">The namespace.</param>
/// <param name="groupIdentifier">The group identifier.</param>
/// <param name="edgeNodeIdentifier">The edge node identifier.</param>
/// <returns>The node command subscription topic <see cref="string"/>.</returns>
internal static string GetNodeCommandSubscribeTopic(SparkplugNamespace nameSpace, string groupIdentifier, string edgeNodeIdentifier)
{
    return $"{nameSpace.GetDescription()}/{groupIdentifier}/{SparkplugMessageType.NodeCommand.GetDescription()}/{edgeNodeIdentifier}";
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions