From f1458f4d28d11bf900f9a539db55ac76a1eba7be Mon Sep 17 00:00:00 2001
From: Ulf Bjorkengren
Copyright © 2024 COVESA®. This document includes material copied from or derived from W3C VISS version 2 - Core.
@@ -117,30 +122,49 @@ already brought off the vehicle.This specification describes a third version of VISS which - has been implemented and deployed on production vehicles. + has been implemented and deployed on production vehicles. The first version of VISS only supported WebSocket as a transport protocol, the second version is generalized to work across different protocols as some are better suited for - different use cases. + different use cases. The second version added support for the HTTP and MQTT transport protocols, subscription capabilities was improved and an access control solution was added.
- +- There are three parts to this specification, [[viss3-core]], [[viss3-payload-encoding]], and TRANSPORT-EXAMPLES. This document, the VISS version 3.0 TRANSPORT-EXAMPLES specification, - describes the VISSv3 transport protocols, and the mapping of the message layer on these transports. + There are three parts to this specification, [[viss3-core]], [[viss3-payload-encoding]], and TRANSPORT-EXAMPLES. This document, the VISS version 3.0 TRANSPORT-EXAMPLES specification, + describes the VISSv3 transport protocols, and the mapping of the message layer on these transports. The companion specification [[viss3-core]] describes the messaging layer, and [[viss3-payload-encoding]] describes payload encodings to/from the primary JSON payload format.
This document describes the transport bindings of the Vehicle Information Service Specification, version 4.0. - The split between transport bindings and messaging layer specifications improves readability and simplifies - extending the specification to further transports in the future. - This specification supports multiple transport bindings, the secure versions of HTTP ([[RFC9112]]), - WebSocket ([[RFC6455]]), and MQTT ([[MQTT]]). +
This document provides examples of how the message payloads defined in [[viss3-core]] are used together with different transport protocols.
+ The Websocket ([[RFC6455]]) transport protocol is used to give an example of how the JSON primary payload format is directly used.
+ This is followed by examples of other transport protocols where exceptions from the primary payload format are defined and exemplified.
+ The Vehicle Information Service Specification, version 3.0 permits any transport protocol to be used that can transport the unaltered primary payload format.
+ Transport protocols that require modifications or transformations of the primary payload format MUST define this in either this document or in the [[viss3-payload-encoding]] document.
+ The transport protocols that define deviations in this document are listed below.
+
Protocol name | +Reference | +
---|---|
HTTP | +[[RFC9112]] | +
MQTT | +[[MQTT]] | +
gRPC | +[gRPC] | +
The server implementation SHALL support the error numbers listed in the table below, +
The server implementation SHALL support the error numbers listed in the table below, with the associated reason and message fields, for all supported transport protocols.
The client SHOULD support any status code defined in [[RFC2616]].
400 (Bad Request) | invalid_data | Data present in the request is invalid. | - +||||||||||||||||||||||||||||||||||||||||||||||||||
401 (Unauthorized) | expired_token | @@ -214,16 +238,16 @@
Object Name | Attribute | Type | Required |
---|---|---|---|
getRequest | action | Action | Yes |
path | string | Yes | |
filter | string | Optional | |
authorization | string | Optional | |
requestId | string | Yes |
Object Name | Attribute | Type | Required |
---|---|---|---|
getSuccessResponse | action | Action | Yes |
requestId | string | Yes | |
data | object | Yes |
+ In the table above the "data" attribute is either an object containing "value" and "ts" name/value pairs, or an array of such objects. +
+Object Name | Attribute | Type | Required |
---|---|---|---|
getErrorResponse | action | Action | Yes |
requestId | string | Yes | |
error | Error | Yes | |
ts | string | Yes |
- The client MAY send a HTTPS GET request message to the server to get one or more value(s) of one or more vehicle signal(s). - If the server is able to satisfy the request it SHALL return a response containing the requested value(s). - If the server is unable to fulfil the request, e.g. because the client is not authorized to retrieve one or more of the signals, - then the server response SHALL have the status code set to indicate error. -
-
- Example:
+ Example:
Request:
- GET /Vehicle/Cabin/SeatPosCount HTTP/1.1
- Host: 127.0.0.1:1337
- Accept: application/json
- ...
+ {
+ "action": "get",
+ "path": "Vehicle.Drivetrain.InternalCombustionEngine.RPM",
+ "requestId": "8756"
+ }
Successful response:
- HTTP/1.1 200 OK
- Content-Type: application/json; charset=utf-8
- ...
{
- "data":{"path":"Vehicle.Cabin.SeatPosCount",
- "dp":{"value":["2", "3", "2"], "ts":"2020-04-15T13:37:00Z"}
- }
+ "action": "get",
+ "requestId": "8756",
+ "data":{"path":"Vehicle.Drivetrain.InternalCombustionEngine.RPM",
+ "dp":{"value":"2372", "ts":"2020-04-15T13:37:00Z"}
+ },
+ "ts":"2020-04-15T13:37:05Z"
}
Error response:
- HTTP/1.1 404 Not Found
- Content-Type: application/json; charset=utf-8
- ...
{
+ "action": "get",
+ "requestId": "8756",
"error": {"number": 404, "reason": "unavailable_data", "message": "The requested data was not found."},
"ts": "2020-04-15T13:37:00Z"
}
Object Name | Attribute | Type | Required |
---|---|---|---|
subscribeSuccessResponse | action | Action | Yes |
requestId | string | Yes | |
unsubscribeSuccessResponse | action | Action | Yes |
subscriptionId | string | Yes | |
ts | string | Yes |
Object Name | Attribute | Type | Required |
---|---|---|---|
subscribeErrorResponse | action | Action | Yes |
requestId | string | Yes | |
error | Error | Yes | |
ts | string | Yes |
Object Name | Attribute | Type | Required |
---|---|---|---|
subscriptionEvent | action | Action | Yes |
subscriptionId | string | Yes | |
data | object | Yes | |
ts | string | Yes |
{
- "action": "subscribe",
- "path": "Vehicle.Drivetrain.FuelSystem.Level",
- "filter": {"variant":"timebased", "parameter":{"period":"500"}},
- "requestId": "6578"
+ "action": "unsubscribe",
+ "subscriptionId": "12345",
+ "requestId": "5786"
}
Successful response:
{
- "action": "subscribe",
- "subscriptionId": "12345",
- "requestId": "6578",
+ "action": "unsubscribe",
+ "requestId": "5786",
"ts": "2020-04-15T13:37:00Z"
}
Error response:
{
- "action": "subscribe",
+ "action": "unsubscribe",
"requestId": "6578",
- "error": {"number": 404, "reason": "unavailable_data", "message": "The requested data was not found."},
+ "error": {"number": 400, "reason": "invalid_data", "message": "Data present in the request is invalid."},
"ts": "2020-04-15T13:37:00Z"
}
- Event:
+
+ The message data components described in the [[viss3-core]] document are in the first hand mapped to required HTTP parameters, + and only when there is no appropriate mapping it is mapped to the payload. + The most significant deviations are: +
Initialization involves setting up a secure HTTPS session between the client and the server.
+ This ensures encrypted communication for data transmission.
+ To initialize a secure session, the client sends a request to the server using the HTTPS protocol.
+ This is achieved by connecting to the server's designated URL using the 'https://' scheme.
+ The client can use a web browser, a native application, or a suitable library in the case of programmatically managed sessions.
+ While the client typically connects to the server using the specified hostname, which often includes the "www" prefix,
+ it's important to note that this convention may not apply in situations where VISS operates within a local, in-vehicle network or if remote vehicle connections are allowed.
+ The communication typically takes place over port 443, the default port for secure HTTPS connections.
+ The hostname resolution can be done via DNS or configured through local settings.
+
Closure entails ending the established HTTPS session when the communication is complete or when the client no longer requires the connection.
+ Either the client or the server can initiate the session closure. The client can signal the end of the session by sending an appropriate request to the server,
+ indicating the intent to close the connection.
+ Upon session closure, any allocated resources, such as server-side threads or memory, are released, improving overall system efficiency.
+
+ The client MAY send a HTTPS GET request message to the server to get one or more value(s) of one or more vehicle signal(s). + If the server is able to satisfy the request it SHALL return a response containing the requested value(s). + If the server is unable to fulfil the request, e.g. because the client is not authorized to retrieve one or more of the signals, + then the server response SHALL have the status code set to indicate error. +
++ Example: + Request: +
+ GET /Vehicle/Cabin/SeatPosCount HTTP/1.1
+ Host: 127.0.0.1:1337
+ Accept: application/json
+ ...
+
+ Successful response:
+ HTTP/1.1 200 OK
+ Content-Type: application/json; charset=utf-8
+ ...
{
- "action": "subscription",
- "subscriptionId": "12345",
- "data": {"path": "Vehicle.Drivetrain.FuelSystem.Level",
- "dp": {"value": "50", "ts": "2020-04-15T13:37:00Z"}
- },
- "ts": "2020-04-15T13:37:00Z"
+ "data":{"path":"Vehicle.Cabin.SeatPosCount",
+ "dp":{"value":["2", "3", "2"], "ts":"2020-04-15T13:37:00Z"}
+ }
}
-
- Error event:
+
+ Error response:
+ HTTP/1.1 404 Not Found
+ Content-Type: application/json; charset=utf-8
+ ...
{
- "action": "subscription",
- "subscriptionId": "12345",
- "error": {"number": 401, "reason": "expired_token", "message": "Access token has expired."},
+ "error": {"number": 404, "reason": "unavailable_data", "message": "The requested data was not found."},
"ts": "2020-04-15T13:37:00Z"
}
-
+
-