Skip to content

Commit

Permalink
Merge pull request #30 from UlfBj/main
Browse files Browse the repository at this point in the history
Data compression support
  • Loading branch information
UlfBj authored Nov 26, 2024
2 parents cbe679a + 392c57c commit 934aadd
Show file tree
Hide file tree
Showing 8 changed files with 253 additions and 958 deletions.
873 changes: 101 additions & 772 deletions spec/VISSv3.0_Core.html

Large diffs are not rendered by default.

187 changes: 3 additions & 184 deletions spec/VISSv3.0_PayloadEncoding.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,199 +171,18 @@ <h2>Protobuf encoding</h2>
encoding and decoding processes, and practical examples. This will enable seamless implementation and interoperability across different systems and
platforms within the automotive ecosystem.
</p>

<section id="protobuf-Schema-definition">
<h2>Protobuf Schema Definition</h2>
<p>
The following protobuf source code describes the VISS message payloads.
Stored in a file e.g. named "viss.proto" the protbuf compiler (protoc) can be used to create helper functions that can be called to encode and decode
between the JSON format and the protobuf format.
The protobuf source code below also contains a "service" clause that the protoc compiler uses to create a gRPC based communication framework.
</p>
<pre><code>
syntax = "proto3";
package grpcProtobufMessages;

enum ResponseStatus {
SUCCESS = 0;
ERROR = 1;
}

enum SubscribeResponseType {
RESPONSE = 0;
EVENT = 1;
}

service VISS {
rpc GetRequest (GetRequestMessage) returns (GetResponseMessage);

rpc SetRequest (SetRequestMessage) returns (SetResponseMessage);

rpc SubscribeRequest (SubscribeRequestMessage) returns (stream SubscribeStreamMessage);

rpc UnsubscribeRequest (UnsubscribeRequestMessage) returns (UnsubscribeResponseMessage);
}

message ErrorResponseMessage {
string Number = 1;
optional string Reason = 2;
optional string Message = 3;
}

message FilterExpressions {
message FilterExpression {
enum FilterVariant {
PATHS = 0;
TIMEBASED = 1;
RANGE = 2;
CHANGE = 3;
CURVELOG = 4;
HISTORY = 5;
STATIC_METADATA = 6;
DYNAMIC_METADATA = 7;
}
FilterVariant Variant = 1;

message FilterValue {
message PathsValue {
repeated string RelativePath = 1;
}
optional PathsValue ValuePaths = 1;

message TimebasedValue {
string Period = 1;
}
optional TimebasedValue ValueTimebased = 2;

message RangeValue {
string LogicOperator = 1;
string Boundary = 2;
}
repeated RangeValue ValueRange = 3;

message ChangeValue {
string LogicOperator = 1;
string Diff = 2;
}
optional ChangeValue ValueChange = 4;

message CurvelogValue {
string MaxErr = 1;
string BufSize = 2;
}
optional CurvelogValue ValueCurvelog = 5;

message HistoryValue {
string TimePeriod = 1; //ISO8601 period expression
}
optional HistoryValue ValueHistory = 6;

message StaticMetadataValue {
string Tree = 1;
}
optional StaticMetadataValue ValueStaticMetadata = 7;

message DynamicMetadataValue {
string MetadataDomain = 1;
}
optional DynamicMetadataValue ValueDynamicMetadata = 8;
}
FilterValue Value = 2;
}
repeated FilterExpression FilterExp = 1;
}

message DataPackages {
message DataPackage {
string Path = 1;

message DataPoint {
string Value = 1;
string Ts = 2;
}
repeated DataPoint Dp = 2;
}
repeated DataPackage Data = 1;
}

message GetRequestMessage {
string Path = 1;
optional FilterExpressions Filter = 2;
optional string Authorization = 3;
optional string RequestId = 4;
}

message GetResponseMessage {
ResponseStatus Status = 1;
message SuccessResponseMessage {
optional DataPackages DataPack = 1;
optional string Metadata = 2; // replaces DataPack in static metadata and one dynamic metadata variant
}
optional SuccessResponseMessage SuccessResponse = 2;
optional ErrorResponseMessage ErrorResponse = 3;
optional string RequestId = 4;
string Ts = 5;
optional string Authorization = 6;
}

message SetRequestMessage {
string Path = 1;
string Value = 2;
optional string Authorization = 3;
optional string RequestId = 4;
}

message SetResponseMessage {
ResponseStatus Status = 1;
optional ErrorResponseMessage ErrorResponse = 2;
optional string RequestId = 3;
string Ts = 4;
optional string Authorization = 5;
}

message SubscribeRequestMessage {
string Path = 1;
optional FilterExpressions Filter = 2;
optional string Authorization = 3;
string RequestId = 4;
}

message SubscribeStreamMessage {
SubscribeResponseType MType = 1;
ResponseStatus Status = 2;

message SubscribeResponseMessage {
optional ErrorResponseMessage ErrorResponse = 1;
optional string SubscriptionId = 2;
string RequestId = 3;
string Ts = 4;
optional string Authorization = 5;
}
optional SubscribeResponseMessage Response = 3;

message SubscribeEventMessage {
string SubscriptionId = 1;
message SuccessResponseMessage {
DataPackages DataPack = 1;
}
optional SuccessResponseMessage SuccessResponse = 2;
optional ErrorResponseMessage ErrorResponse = 3;
string Ts = 4;
}
optional SubscribeEventMessage Event = 4;
}

message UnsubscribeRequestMessage {
string SubscriptionId = 1;
optional string RequestId = 2;
}

message UnsubscribeResponseMessage {
ResponseStatus Status = 1;
optional ErrorResponseMessage ErrorResponse = 2;
optional string RequestId = 3;
string Ts = 4;
}
<embed type="text/protobuf" src="resources/vissv3.0.proto" width="700" height="500">
</code></pre>
</p>
</section>

<section id="transport-protocol-realizations">
Expand Down
Binary file added spec/images/data-compression-scheme-coding.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added spec/images/data-compression-sequence-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
137 changes: 137 additions & 0 deletions spec/resources/server.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#
# The server capabilities declaration.
#
Server:
type: branch
description: Root for the server capabilities.

Server.Support:
type: branch
description: Top branch declaring the server supported features.

Server.Support.Protocol:
type: attribute
datatype: string[]
description: List of supported transport protocols.

Server.Support.Security:
type: attribute
datatype: string[]
description: List of supported security related features.

Server.Support.Filter:
type: attribute
datatype: string[]
description: List of supported filter features.

Server.Config:
type: branch
description: Top branch declaring the configuration of server supported features.

Server.Config.Protocol:
type: branch
description: Top branch declaring the configuration of server supported protocols.

Server.Config.Protocol.Http:
type: branch
description: Top branch for the server supported HTTP protocol.

Server.Config.Protocol.Http.Primary:
type: branch
description: HTTP configuration for the primary payload format.

Server.Config.Protocol.Http.Primary.PortNum:
type: attribute
datatype: uint32
description: HTTP port number for the primary payload format.

Server.Config.Protocol.Websocket:
type: branch
description: Top branch for the server supported Websocket protocol.

Server.Config.Protocol.Websocket.Primary:
type: branch
description: Websocket configuration for the primary payload format.

Server.Config.Protocol.Websocket.Primary.PortNum:
type: attribute
datatype: uint32
description: Websocket protocol port number for the primary payload format.

Server.Config.Protocol.Websocket.Protobuf:
type: branch
description: Websocket configuration for the protobuf encoded payload format.

Server.Config.Protocol.Websocket.Protobuf.PortNum:
type: attribute
datatype: uint32
description: Websocket protocol port number for the protobuf encoded payload format.

Server.Config.Protocol.Mqtt:
type: branch
description: Top branch for the server supported MQTT protocol.

Server.Config.Protocol.Mqtt.PortNum:
type: attribute
datatype: uint32
description: MQTT port number.

Server.Config.Protocol.Mqtt.Primary:
type: branch
description: MQTT configuration for the primary payload format.

Server.Config.Protocol.Mqtt.Primary.Topic:
type: attribute
datatype: string
description: MQTT topic name for the primary payload format.

Server.Config.Protocol.Mqtt.Protobuf:
type: branch
description: MQTT configuration for the protobuf encoded payload format.

Server.Config.Protocol.Mqtt.Protobuf.Topic:
type: attribute
datatype: string
description: MQTT topic name for the protobuf encoded payload format.

Server.Config.Protocol.Grpc:
type: branch
description: Top branch for the server supported gRPC protocol.

Server.Config.Protocol.Grpc.Protobuf:
type: branch
description: gRPC configuration with the protobuf encoded payload format.

Server.Config.Protocol.Grpc.Protobuf.PortNum:
type: attribute
datatype: uint32
description: gRPC port number for the protobuf encoded payload format.

Server.Config.AccessControl:
type: branch
description: Access control configuration.

Server.Config.AccessControl.AgtsUrl:
type: attribute
datatype: string
description: Access Grant Token Server URL including port number and path.

Server.Config.AccessControl.AtsPortNum:
type: attribute
datatype: uint32
description: Access Token Server port number.

Server.Config.AccessControl.Flow:
type: attribute
datatype: string
description: Supported access control flows.

Server.Config.Consent:
type: branch
description: Consent configuration.

Server.Config.Consent.Ecf:
type: attribute
datatype: string
description: External Consent Framework description.

Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
"description": "The access token",
"type": "string"
},
"dc": {
"description": "The data compression scheme",
"type": "string"
},
"requestId": {
"description": "The request id",
"type": "string"
Expand Down Expand Up @@ -200,6 +204,10 @@
"description": "The access token",
"type": "string"
},
"dc": {
"description": "The data compression scheme",
"type": "string"
},
"requestId": {
"description": "The request id",
"type": "string"
Expand Down
6 changes: 4 additions & 2 deletions resources/vissv3.0.proto → spec/resources/vissv3.0.proto
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ message GetRequestMessage {
string Path = 1;
optional FilterExpressions Filter = 2;
optional string Authorization = 3;
optional string RequestId = 4;
optional string DataCompression = 4;
optional string RequestId = 5;
}

message GetResponseMessage {
Expand Down Expand Up @@ -142,7 +143,8 @@ message SubscribeRequestMessage {
string Path = 1;
optional FilterExpressions Filter = 2;
optional string Authorization = 3;
string RequestId = 4;
optional string DataCompression = 4;
string RequestId = 5;
}

message SubscribeStreamMessage {
Expand Down

0 comments on commit 934aadd

Please sign in to comment.