/// <summary> /// Gets the topic (Except STATE messages). /// </summary> /// <param name="nameSpace">The namespace.</param> /// <param name="groupIdentifier">The group identifier.</param> /// <param name="messageType">The message type.</param> /// <param name="edgeNodeIdentifier">The edge node identifier.</param> /// <param name="deviceIdentifier">The device identifier. (Optional)</param> /// <returns>The topic as <see cref="string"/>.</returns> public static string GetTopic( SparkplugNamespace nameSpace, string groupIdentifier, SparkplugMessageType messageType, string edgeNodeIdentifier, string?deviceIdentifier) { return(string.IsNullOrWhiteSpace(deviceIdentifier) ? $"{nameSpace.GetDescription()}/{groupIdentifier}/{messageType.GetDescription()}/{edgeNodeIdentifier}" : $"{nameSpace.GetDescription()}/{groupIdentifier}/{messageType.GetDescription()}/{edgeNodeIdentifier}/{deviceIdentifier}"); }
/// <summary> /// Gets the device 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> /// <param name="deviceIdentifier">The device identifier.</param> /// <returns>The wildcard device command subscription topic <see cref="string"/>.</returns> public static string GetDeviceCommandSubscribeTopic(SparkplugNamespace nameSpace, string groupIdentifier, string edgeNodeIdentifier, string deviceIdentifier) { return($"{nameSpace.GetDescription()}/{groupIdentifier}/{SparkplugMessageType.DeviceCommand.GetDescription()}/{edgeNodeIdentifier}/{deviceIdentifier}"); }
/// <summary> /// Gets the wildcard namespace subscription topic. /// </summary> /// <param name="nameSpace">The namespace.</param> /// <returns>The wildcard namespace subscription topic <see cref="string"/></returns> public static string GetWildcardNamespaceSubscribeTopic(SparkplugNamespace nameSpace) { return($"{nameSpace.GetDescription()}/#"); }