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

kuksa.val server also accepts value as number #209

Closed
wenwenchenbosch opened this issue Jun 23, 2021 · 4 comments
Closed

kuksa.val server also accepts value as number #209

wenwenchenbosch opened this issue Jun 23, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@wenwenchenbosch
Copy link
Contributor

wenwenchenbosch commented Jun 23, 2021

VISS V2 defined, that value to be set and read should be string. see https://raw.githack.com/w3c/automotive/gh-pages/spec/VISSv2_Transport.html#term-def

Attribute Type Description
value string The data value associated with the path.

The definition for setRequest is:

Attribute Type Required
action Action Yes
path string Yes
value string Yes
authorization string Optional
requestId string Yes

But currently, kuksa.val server also accepts value as number, which is quite wired:

Test Client> setValue Vehicle.Speed 200
{
    "action": "set", 
    "requestId": "452ac2c3-210c-49f2-a43e-21f75c47128f", 
    "timestamp": 1624441378347
}

Test Client> getValue Vehicle.Speed 
{
    "action": "get", 
    "path": "Vehicle.Speed", 
    "requestId": "60e470d2-78d9-4412-bc7c-414ad3afe158", 
    "timestamp": "1624441378347", 
    "value": "200"
}

Test Client> setValue Vehicle.Speed "201"
{
    "action": "set", 
    "requestId": "82be8795-83ad-4157-b374-d6730d282aa9", 
    "timestamp": 1624441395049
}

Test Client> getValue Vehicle.Speed 
{
    "action": "get", 
    "path": "Vehicle.Speed", 
    "requestId": "eb218e26-e97a-43b8-8f3e-6491057f432c", 
    "timestamp": "1624441395049", 
    "value": "201"
}
@wenwenchenbosch
Copy link
Contributor Author

There is some strange behavior, if the value to set is not string, see #211 (comment).

@wenwenchenbosch
Copy link
Contributor Author

wait for answer from w3c: w3c/automotive#386

@wenwenchenbosch
Copy link
Contributor Author

Hi @SebastianSchildt, I see that w3c/automotive#386 is closed, something is agreed regarding to json ref. What should we do here in kuksa.val?

@SebastianSchildt
Copy link
Contributor

This is fixed in current master. We will always store the native datatype in database, but we make sure VISS always returns string, (we are generous in what what we accept).

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants