Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of NamedSignalValue #31

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

erikbosch
Copy link
Contributor

@erikbosch erikbosch commented Sep 20, 2024

Fixes #30

I used VSS 4.2 as basis for testing, so I added that as well to our example collection. See end of 4.2 *.vspec file to find added testcases.

How to test:

Start Databroker with 4.2 (could be std 4.2)

erik@debian6:~/kuksa-databroker$ cargo run --bin databroker -- --metadata ~/kuksa-can-provider/mapping/vss_4.2/vss_dbc.json

Run dbcfeeder

./dbcfeeder.py

Use kuksa-client to test results.

Test Client> getValue Vehicle.Cabin.Infotainment.HMI.SpeedUnit
{
    "path": "Vehicle.Cabin.Infotainment.HMI.SpeedUnit",
    "value": {
        "value": "KILOMETERS_PER_HOUR",
        "timestamp": "2024-09-20T10:25:27.978556+00:00"
    }
}

Test Client> getValue Vehicle.Cabin.Infotainment.Media.Played.Album
{
    "path": "Vehicle.Cabin.Infotainment.Media.Played.Album",
    "value": {
        "value": "DI_SPEED_KPH",
        "timestamp": "2024-09-20T10:25:50.193728+00:00"
    }
}

Test Client> getValue Vehicle.Cabin.Infotainment.Media.Volume
{
    "path": "Vehicle.Cabin.Infotainment.Media.Volume",
    "value": {
        "value": 1,
        "timestamp": "2024-09-20T10:25:55.723813+00:00"
    }
}

@erikbosch erikbosch force-pushed the erik_named branch 2 times, most recently from 3f8b232 to fa35af5 Compare September 20, 2024 11:32
Fixes eclipse-kuksa#30

Signed-off-by: Erik Jaegervall <erik.jaegervall@se.bosch.com>
Copy link
Contributor

@mikehaller mikehaller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I've been debuging that previously and I also think it's just the missing IsInstance check for the CAN-Tools NamedValue value. The approach to guess based on the target datatype is good enough imho, esp. for prototyping and development purposes.

Copy link
Contributor

@SebastianSchildt SebastianSchildt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trust erik, believe mike, lgtm

@SebastianSchildt SebastianSchildt merged commit dec1e05 into eclipse-kuksa:main Sep 26, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError for custom DBC Mapping
3 participants