Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit fdf05e2

Browse files
Merge pull request #126 from boschresearch/feature/set_protocol_docu
Feature/set protocol docu
2 parents 58339a1 + 7b402f5 commit fdf05e2

File tree

4 files changed

+199
-9
lines changed

4 files changed

+199
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ This is KUKSA.val, the KUKSA **V**ehicle **A**bstration **L**ayer.
88
[![Build Status](https://ci.eclipse.org/kuksa/buildStatus/icon?job=kuksa.val%2Fmaster)](https://ci.eclipse.org/kuksa/job/kuksa.val/job/master/)
99

1010

11-
KUKSA.val provides a [Genivi VSS data model](https://github.com/GENIVI/vehicle_signal_specification) describing data in a vehicle. This data is provided to applications using a variant based on the W3C VISS Interface. KUKSA.val supports VISS V1 https://www.w3.org/TR/vehicle-information-service/ and extensions as well as parts of the upcomming VISS2 standard (https://raw.githack.com/w3c/automotive/gh-pages/spec/Gen2_Core.html, https://raw.githack.com/w3c/automotive/gh-pages/spec/Gen2_Transport.html), that are applicable to in-vehicle VSS servers.
11+
KUKSA.val provides a [Genivi VSS data model](https://github.com/GENIVI/vehicle_signal_specification) describing data in a vehicle. This data is provided to applications using a variant based on the W3C VISS Interface. KUKSA.val supports VISS V1 https://www.w3.org/TR/vehicle-information-service/ and extensions as well as parts of the upcomming VISS2 standard ([Gen2 Core](https://raw.githack.com/w3c/automotive/gh-pages/spec/VISSv2_Core.html), [Gen2 Transport](https://raw.githack.com/w3c/automotive/gh-pages/spec/VISSv2_Transport.html)), that are applicable to in-vehicle VSS servers.
1212

13-
See [Supported Protocol](doc/protocol.md) for a detailled overview.
13+
See [Supported Protocol](doc/protocol/README.md) for a detailled overview.
1414

1515
## Features
1616
- Websocket interface, TLS-secured or plain

doc/protocol/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# KUKSA.val Protocol
2+
3+
KUKSA.val supports VISS V1 https://www.w3.org/TR/vehicle-information-service/ and extensions as well as parts of the upcomming VISS2 standard (https://raw.githack.com/w3c/automotive/gh-pages/spec/Gen2_Core.html, https://raw.githack.com/w3c/automotive/gh-pages/spec/Gen2_Transport.html), that are applicable to in-vehicle VSS servers.
4+
5+
The following documents will detail, what is supported on the Websocket Interface:
6+
7+
8+
## [get calls](get.md)
9+
## [set calls](set.md)

doc/protocol.md renamed to doc/protocol/get.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# KUKSA.val Protocol
2-
3-
KUKSA.val supports VISS V1 https://www.w3.org/TR/vehicle-information-service/ and extensions as well as parts of the upcomming VISS2 standard (https://raw.githack.com/w3c/automotive/gh-pages/spec/Gen2_Core.html, https://raw.githack.com/w3c/automotive/gh-pages/spec/Gen2_Transport.html), that are applicable to in-vehicle VSS servers.
4-
5-
This document will detail, what is supported on the Websocket Interface
6-
7-
81
## get: Read data
92

103
KUKSA.val supports basic get requests according to VISS validated against the following schema.

doc/protocol/set.md

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
## set: Write data
2+
3+
KUKSA.val supports basic set requests according to VISS validated against the [following schema](https://github.com/eclipse/kuksa.val/blob/master/include/VSSRequestJsonSchema.hpp#L48-L71):
4+
5+
6+
```json
7+
{
8+
"$schema": "http://json-schema.org/draft-04/schema#",
9+
"title": "Set Request",
10+
"description": "Enables the client to set one or more values once.",
11+
"type": "object",
12+
"required": ["action", "path", "value", "requestId"],
13+
"properties": {
14+
"action": {
15+
"enum": [ "set" ],
16+
"description": "The identifier for the set request"
17+
},
18+
"path": {
19+
"$ref": "viss#/definitions/path"
20+
},
21+
"value": {
22+
"$ref": "viss#/definitions/value"
23+
},
24+
"requestId": {
25+
"$ref": "viss#/definitions/requestId"
26+
}
27+
}
28+
}
29+
```
30+
31+
The following shows some valid and invalid sample requests. Unless otherwise noticed, we assume you are authorised to read the paths used in the examples.
32+
33+
### VSS1-Path Example Request
34+
35+
KUKSA.val supports VISS1 (dot-seperated) and VISS2 (slash-seperated) paths. VISS1 example:
36+
37+
```json
38+
{
39+
"action": "set",
40+
"path": "Vehicle.Speed",
41+
"value": "200",
42+
"requestId": "4204a97e-d25e-4ba9-891b-1703145865bd"
43+
}
44+
```
45+
46+
### Response
47+
48+
```json
49+
{
50+
"action": "set",
51+
"requestId": "4204a97e-d25e-4ba9-891b-1703145865bd",
52+
"timestamp": 1615832573528
53+
}
54+
```
55+
56+
### VISS2-Path Example Request
57+
58+
```json
59+
{
60+
"action": "set",
61+
"path": "Vehicle/Speed",
62+
"value": "200",
63+
"requestId": "8cedc7c8-089d-48d6-b913-9f1504c14342"
64+
}
65+
```
66+
67+
### Response
68+
69+
```json
70+
{
71+
"action": "set",
72+
"requestId": "8cedc7c8-089d-48d6-b913-9f1504c14342",
73+
"timestamp": 1615832646622
74+
}
75+
```
76+
77+
## Wildcards/Multisets
78+
79+
Setting wildcards/multiple values or branches is currently not supported
80+
81+
### Try setting branch
82+
83+
```json
84+
{
85+
"action": "set",
86+
"path": "Vehicle",
87+
"value": "200",
88+
"requestId": "3ef9e4c1-ff99-4b2c-be13-ce69bfb170b0"
89+
}
90+
```
91+
92+
### Response
93+
94+
```json
95+
{
96+
"action": "set",
97+
"error": {
98+
"message": "Can not set Vehicle. Only sensor or actor leaves can be set.",
99+
"number": 403,
100+
"reason": "Forbidden"
101+
},
102+
"requestId": "3ef9e4c1-ff99-4b2c-be13-ce69bfb170b0",
103+
"timestamp": 1615832783387
104+
}
105+
```
106+
107+
### Try setting attribute
108+
Attributes are considered a deployment attribute that does not change during the lifetime of a vehicle, therefore they can not be set using normal means. KUKSA.val assumes them to be initialized correctly by the loaded VSS JSON.
109+
110+
```json
111+
{
112+
"action": "set",
113+
"path": "Vehicle/VehicleIdentification/VIN",
114+
"value": "deadbeef",
115+
"requestId": "4544fd5f-249e-4da6-8576-248b42504394"
116+
}
117+
```
118+
119+
### Response
120+
121+
```json
122+
{
123+
"action": "set",
124+
"error": {
125+
"message": "Can not set Vehicle/VehicleIdentification/VIN. Only sensor or actor leaves can be set.",
126+
"number": 403,
127+
"reason": "Forbidden"
128+
},
129+
"requestId": "4544fd5f-249e-4da6-8576-248b42504394",
130+
"timestamp": 1615833005144
131+
}
132+
133+
```
134+
135+
### Non-existing path
136+
As expected, trying to set a non-existent path returns a 404
137+
138+
```json
139+
{
140+
"action": "set",
141+
"path": "Vehicle/FluxCapacitor/Charge",
142+
"value": "1.21",
143+
"requestId": "882a6bdd-ff74-433a-a7c4-c2ce2c7f5c07"
144+
}
145+
```
146+
147+
### Response
148+
149+
```json
150+
{
151+
"action": "set",
152+
"error": {
153+
"message": "I can not find Vehicle/FluxCapacitor/Charge in my db",
154+
"number": 404,
155+
"reason": "Path not found"
156+
},
157+
"requestId": "882a6bdd-ff74-433a-a7c4-c2ce2c7f5c07",
158+
"timestamp": 1615833326191
159+
}
160+
```
161+
162+
### Authorization Checks first
163+
Please note, that authorization is checked *first*, i.e. in the previous example, if we do not have a permission covering the requested path, no matter it exists or not, we get a 403
164+
165+
```json
166+
{
167+
"action": "set",
168+
"path": "Vehicle/FluxCapacitor/Charge",
169+
"value": "1.21",
170+
"requestId": "458a269f-ca42-4175-b88c-5ff8bea7855e"
171+
}
172+
```
173+
174+
### Response
175+
176+
```json
177+
{
178+
"action": "set",
179+
"error": {
180+
"message": "No write access to Vehicle/FluxCapacitor/Charge",
181+
"number": 403,
182+
"reason": "Forbidden"
183+
},
184+
"requestId": "458a269f-ca42-4175-b88c-5ff8bea7855e",
185+
"timestamp": 1615833458803
186+
}
187+
```
188+

0 commit comments

Comments
 (0)