Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 64 additions & 70 deletions specification/src/main/asciidoc/chapters/Sparkplug_6_Payloads.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -160,36 +160,35 @@ enum DataType {
Boolean = 11;
String = 12;
DateTime = 13;
Text = 14;

// Additional Metric Types
UUID = 15;
DataSet = 16;
Bytes = 17;
File = 18;
Template = 19;
UUID = 14;
DataSet = 15;
Bytes = 16;
File = 17;
Template = 18;

// Additional PropertyValue Types
PropertySet = 20;
PropertySetList = 21;
PropertySet = 19;
PropertySetList = 20;

// Array Types
Int8Array = 22;
Int16Array = 23;
Int32Array = 24;
Int64Array = 25;
UInt8Array = 26;
UInt16Array = 27;
UInt32Array = 28;
UInt64Array = 29;
FloatArray = 30;
DoubleArray = 31;
BooleanArray = 32;
StringArray = 33;
DateTimeArray = 34;
Int8Array = 21;
Int16Array = 22;
Int32Array = 23;
Int64Array = 24;
UInt8Array = 25;
UInt16Array = 26;
UInt32Array = 27;
UInt64Array = 28;
FloatArray = 29;
DoubleArray = 30;
BooleanArray = 31;
StringArray = 32;
DateTimeArray = 33;

// Command Type
Command = 35; // A callable command/function metric - the value is carried in the Metric 'command' field
Command = 34; // A callable command/function metric - the value is carried in the Metric 'command' field
}

// Per-metric operation, used only within NMMETA/DMMETA (modified metadata) messages to denote a
Expand Down Expand Up @@ -265,7 +264,7 @@ message Payload {
repeated float float_values = 6; // Float
repeated double double_values = 7; // Double
repeated bool boolean_values = 8; // Boolean
repeated string string_values = 9; // String, Text
repeated string string_values = 9; // String

// The indexes of the elements that are null. Omitted entirely when none are.
repeated uint32 null_indexes = 10;
Expand Down Expand Up @@ -1674,36 +1673,35 @@ enum DataType {
Boolean = 11;
String = 12;
DateTime = 13;
Text = 14;

// Additional Metric Types
UUID = 15;
DataSet = 16;
Bytes = 17;
File = 18;
Template = 19;
UUID = 14;
DataSet = 15;
Bytes = 16;
File = 17;
Template = 18;

// Additional PropertyValue Types
PropertySet = 20;
PropertySetList = 21;
PropertySet = 19;
PropertySetList = 20;

// Array Types
Int8Array = 22;
Int16Array = 23;
Int32Array = 24;
Int64Array = 25;
UInt8Array = 26;
UInt16Array = 27;
UInt32Array = 28;
UInt64Array = 29;
FloatArray = 30;
DoubleArray = 31;
BooleanArray = 32;
StringArray = 33;
DateTimeArray = 34;
Int8Array = 21;
Int16Array = 22;
Int32Array = 23;
Int64Array = 24;
UInt8Array = 25;
UInt16Array = 26;
UInt32Array = 27;
UInt64Array = 28;
FloatArray = 29;
DoubleArray = 30;
BooleanArray = 31;
StringArray = 32;
DateTimeArray = 33;

// Command Type
Command = 35; // A callable command/function metric - the value is carried in the Metric 'command' field
Command = 34; // A callable command/function metric - the value is carried in the Metric 'command' field
}
----

Expand Down Expand Up @@ -1772,44 +1770,40 @@ representation it interoperates with is signed, so the ceiling is 2262-04-11 as
link:#operational_behavior_timestamps[Timestamps] section. A DateTime carried in an array or a DataSet.Column
uses the int64_values array of the ValueArray, as the
link:#payloads_p_datatype_array[Array Types] section describes.
* _Text_
** String value (UTF-8)
** Google Protocol Buffer Type: string
** Sparkplug enum value: 14

[[payloads_p_datatype_additional]]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the Text block also removed the blank line before this anchor, so Asciidoctor treats [[payloads_p_datatype_additional]] as part of the DateTime item's paragraph, and the id doesn't appear in the HTML. I built the HTML: develop has <div id="payloads_p_datatype_additional" class="ulist"> and this branch has no element with that id. Nothing in the spec links to it, but outside deep links would break. Restoring the blank line above it fixes it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 53db58c. Good catch — and the kind that only shows up if you actually render the document.

Removing the Text block took the blank line that separated it from the anchor with it, so Asciidoctor read [[payloads_p_datatype_additional]] as part of the preceding DateTime paragraph. Confirmed the way you did, by building the HTML: the id is absent before the change and present after, alongside payloads_p_datatype_basic and payloads_p_datatype_array.

I also swept every chapter for an anchor with no blank line above it. One other turned up, in Sparkplug_8_HA.adoc:165, but it is inside a //// comment block and identical on develop, so it is inert and pre-existing.

Worth noting my own anchor check would never have caught this: it verifies that every link:# target resolves to an anchor in the source, which this one still did. The failure was in the rendering, which only a build of the HTML exposes.

* *Additional Types*
** _UUID_
*** UUID value as a UTF-8 string
*** Google Protocol Buffer Type: string
*** Sparkplug enum value: 15
*** Sparkplug enum value: 14
** _DataSet_
*** DataSet as defined link:#payloads_p_dataset[here]
*** Google Protocol Buffer Type: none – defined in Sparkplug
*** Sparkplug enum value: 16
*** Sparkplug enum value: 15
** _Bytes_
*** Array of bytes
*** Google Protocol Buffer Type: bytes
*** Sparkplug enum value: 17
*** Sparkplug enum value: 16
** _File_
*** Array of bytes representing a file
*** Google Protocol Buffer Type: bytes
*** Sparkplug enum value: 18
*** Sparkplug enum value: 17
** _Template_
*** Template as defined link:#payloads_p_template[here]
*** Google Protocol Buffer Type: none – defined in Sparkplug
*** Sparkplug enum value: 19
*** Sparkplug enum value: 18

[[payloads_p_datatype_propertyvalue]]
* *Additional PropertyValue Types*
** _PropertySet_
*** PropertySet as defined link:#payloads_p_propertyset[here]
*** Google Protocol Buffer Type: none – defined in Sparkplug
*** Sparkplug enum value: 20
*** Sparkplug enum value: 19
** _PropertySetList_
*** PropertySetList as defined link:#payloads_p_propertysetlist[here]
*** Google Protocol Buffer Type: none – defined in Sparkplug
*** Sparkplug enum value: 21
*** Sparkplug enum value: 20

[[payloads_p_datatype_array]]
* *Array Types*
Expand Down Expand Up @@ -1848,43 +1842,43 @@ null_indexes to [1].

** _Int8Array_
*** Elements are carried in the sint32_values field of the ValueArray
*** Sparkplug enum value: 22
*** Sparkplug enum value: 21
** _Int16Array_
*** Elements are carried in the sint32_values field of the ValueArray
*** Sparkplug enum value: 23
*** Sparkplug enum value: 22
** _Int32Array_
*** Elements are carried in the sint32_values field of the ValueArray
*** Sparkplug enum value: 24
*** Sparkplug enum value: 23
** _Int64Array_
*** Elements are carried in the sint64_values field of the ValueArray
*** Sparkplug enum value: 25
*** Sparkplug enum value: 24
** _UInt8Array_
*** Elements are carried in the uint32_values field of the ValueArray
*** Sparkplug enum value: 26
*** Sparkplug enum value: 25
** _UInt16Array_
*** Elements are carried in the uint32_values field of the ValueArray
*** Sparkplug enum value: 27
*** Sparkplug enum value: 26
** _UInt32Array_
*** Elements are carried in the uint32_values field of the ValueArray
*** Sparkplug enum value: 28
*** Sparkplug enum value: 27
** _UInt64Array_
*** Elements are carried in the uint64_values field of the ValueArray
*** Sparkplug enum value: 29
*** Sparkplug enum value: 28
** _FloatArray_
*** Elements are carried in the float_values field of the ValueArray
*** Sparkplug enum value: 30
*** Sparkplug enum value: 29
** _DoubleArray_
*** Elements are carried in the double_values field of the ValueArray
*** Sparkplug enum value: 31
*** Sparkplug enum value: 30
** _BooleanArray_
*** Elements are carried in the boolean_values field of the ValueArray
*** Sparkplug enum value: 32
*** Sparkplug enum value: 31
** _StringArray_
*** Elements are carried in the string_values field of the ValueArray
*** Sparkplug enum value: 33
*** Sparkplug enum value: 32
** _DateTimeArray_
*** Elements are carried in the int64_values field of the ValueArray
*** Sparkplug enum value: 34
*** Sparkplug enum value: 33

[[payloads_p_datatype_command]]
* *Command Type*
Expand All @@ -1893,7 +1887,7 @@ null_indexes to [1].
object as defined link:#payloads_p_command[here]. A Command metric carries its content in the
Metric _command_ field rather than the _value_ field.
*** Google Protocol Buffer Type: none – defined in Sparkplug
*** Sparkplug enum value: 35
*** Sparkplug enum value: 34

[[payloads_payload_representation_on_host_applications]]
==== Payload Representation on Host Applications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ private Value<?> getValueFromNode(JsonNode nodeValue, DataSetDataType type) {
case UInt32:
case Int64:
return new Value<Long>(type, (long) nodeValue.asLong());
case Text:
case String:
return new Value<String>(type, nodeValue.asText());
case UInt64:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ private SparkplugBProto.Payload.PropertySet.Builder convertPropertySet(PropertyS
builder.setUint64Value(bigIntegerToUnsignedLong((BigInteger) value.getValue()));
break;
case String:
case Text:
builder.setStringValue((String) value.getValue());
break;
case PropertySet:
Expand Down Expand Up @@ -288,7 +287,6 @@ private SparkplugBProto.Payload.Template.Parameter.Builder setParameterValue(
case UInt64:
builder.getTypedValueBuilder().setUint64Value(bigIntegerToUnsignedLong((BigInteger) value));
break;
case Text:
case String:
builder.getTypedValueBuilder().setStringValue((String) value);
break;
Expand Down Expand Up @@ -356,7 +354,6 @@ private SparkplugBProto.Payload.Metric.Builder setMetricValue(SparkplugBProto.Pa
metricBuilder.getValueBuilder().setUint64Value(bigIntegerToUnsignedLong((BigInteger) metric.getValue()));
break;
case String:
case Text:
case UUID:
metricBuilder.getValueBuilder().setStringValue((String) metric.getValue());
break;
Expand Down Expand Up @@ -741,7 +738,6 @@ private void addDataSetValue(SparkplugBProto.Payload.DataSet.Column.Builder colu
va.addBooleanValues(toBoolean(raw));
break;
case String:
case Text:
va.addStringValues((String) raw);
break;
default:
Expand Down Expand Up @@ -813,7 +809,6 @@ private void addDataSetPlaceholder(SparkplugBProto.Payload.DataSet.Column.Builde
va.addBooleanValues(false);
break;
case String:
case Text:
va.addStringValues("");
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public enum DataSetDataType {
Boolean(11, Boolean.class),
String(12, String.class),
DateTime(13, Date.class),
Text(14, String.class),

// Unknown
Unknown(0, Object.class);
Expand Down Expand Up @@ -99,8 +98,6 @@ public static DataSetDataType fromInteger(int i) {
return String;
case 13:
return DateTime;
case 14:
return Text;
default:
return Unknown;
}
Expand Down
Loading
Loading