5 // cd client_libraries/java
6 // protoc --proto_path=../../ --java_out=src/main/java ../../sparkplug_b.proto
8 package com.cirruslink.sparkplug.protobuf;
10 option java_package = "com.cirruslink.sparkplug.protobuf";
11 option java_outer_classname = "SparkplugBProto";
15 // Indexes of Data Types
17 // Unknown placeholder for future expansion.
36 // Additional Metric Types
43 // Additional PropertyValue Types
52 optional string name = 1;
53 optional uint32 type = 2;
57 uint64 long_value = 4;
58 float float_value = 5;
59 double double_value = 6;
60 bool boolean_value = 7;
61 string string_value = 8;
62 ParameterValueExtension extension_value = 9;
65 message ParameterValueExtension {
70 optional string version = 1; // The version of the Template to prevent mismatches
71 repeated Metric metrics = 2; // Each metric is the name of the metric and the datatype of the member but does not contain a value
72 repeated Parameter parameters = 3;
73 optional string template_ref = 4; // Reference to a template if this is extending a Template or an instance - must exist if an instance
74 optional bool is_definition = 5;
80 message DataSetValue {
84 uint64 long_value = 2;
85 float float_value = 3;
86 double double_value = 4;
87 bool boolean_value = 5;
88 string string_value = 6;
89 DataSetValueExtension extension_value = 7;
92 message DataSetValueExtension {
98 repeated DataSetValue elements = 1;
99 extensions 2 to max; // For third party extensions
102 optional uint64 num_of_columns = 1;
103 repeated string columns = 2;
104 repeated uint32 types = 3;
105 repeated Row rows = 4;
106 extensions 5 to max; // For third party extensions
109 message PropertyValue {
111 optional uint32 type = 1;
112 optional bool is_null = 2;
115 uint32 int_value = 3;
116 uint64 long_value = 4;
117 float float_value = 5;
118 double double_value = 6;
119 bool boolean_value = 7;
120 string string_value = 8;
121 PropertySet propertyset_value = 9;
122 PropertySetList propertysets_value = 10; // List of Property Values
123 PropertyValueExtension extension_value = 11;
126 message PropertyValueExtension {
131 message PropertySet {
132 repeated string keys = 1; // Names of the properties
133 repeated PropertyValue values = 2;
137 message PropertySetList {
138 repeated PropertySet propertyset = 1;
143 // Bytes specific metadata
144 optional bool is_multi_part = 1;
147 optional string content_type = 2; // Content/Media type
148 optional uint64 size = 3; // File size, String size, Multi-part size, etc
149 optional uint64 seq = 4; // Sequence number for multi-part messages
152 optional string file_name = 5; // File name
153 optional string file_type = 6; // File type (i.e. xml, json, txt, cpp, etc)
154 optional string md5 = 7; // md5 of data
156 // Catchalls and future expansion
157 optional string description = 8; // Could be anything such as json or xml of custom properties
163 optional string name = 1; // Metric name - should only be included on birth
164 optional uint64 alias = 2; // Metric alias - tied to name on birth and included in all later DATA messages
165 optional uint64 timestamp = 3; // Timestamp associated with data acquisition time
166 optional uint32 datatype = 4; // DataType of the metric/tag value
167 optional bool is_historical = 5; // If this is historical data and should not update real time tag
168 optional bool is_transient = 6; // Tells consuming clients such as MQTT Engine to not store this as a tag
169 optional bool is_null = 7; // If this is null - explicitly say so rather than using -1, false, etc for some datatypes.
170 optional MetaData metadata = 8; // Metadata for the payload
171 optional PropertySet properties = 9;
174 uint32 int_value = 10;
175 uint64 long_value = 11;
176 float float_value = 12;
177 double double_value = 13;
178 bool boolean_value = 14;
179 string string_value = 15;
180 bytes bytes_value = 16; // Bytes, File
181 DataSet dataset_value = 17;
182 Template template_value = 18;
183 MetricValueExtension extension_value = 19;
186 message MetricValueExtension {
191 optional uint64 timestamp = 1; // Timestamp at message sending time
192 repeated Metric metrics = 2; // Repeated forever - no limit in Google Protobufs
193 optional uint64 seq = 3; // Sequence number
194 optional string uuid = 4; // UUID to track message type in terms of schema definitions
195 optional bytes body = 5; // To optionally bypass the whole definition above
196 extensions 6 to max; // For third party extensions