diff options
author | 2022-06-06 20:02:33 -0400 | |
---|---|---|
committer | 2022-06-06 20:27:59 -0400 | |
commit | 59f8e2629f4295e89197a9d475241e87f0b9749b (patch) | |
tree | 4c8c80729b4af24fcff8564ecaa08d64c2ca78ef /recipes-connectivity/kuksa-val | |
parent | 6d869cb805058bb5be8e2eac93853d430076bcdc (diff) |
kuksa-dbc-feeder-sllin: add recipe
Add kuksa-dbc-feeder-sllin recipe to install systemd unit and
configuration file to run a second copy of the KUKSA.val DBC
feeder against the demo setup's sllin0 interface. The systemd
unit will bring up the sllin0 interface by a call to the
can-dev-helper.sh script if run on hardware that lacks the
LIN adapter. Additionally, the DBC feeder mapping configuration
has been updated with the mappings for the steering wheel LIN
events, and kuksa-dbc-feeder-sllin has been added to the
agl-demo-preload packagegroup for the full AGL demo setup.
Bug-AGL: SPEC-4405
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I360bdf050f75b6a505b5c1748c6216972d5723c1
Diffstat (limited to 'recipes-connectivity/kuksa-val')
5 files changed, 147 insertions, 0 deletions
diff --git a/recipes-connectivity/kuksa-val/can-dev-helper/can-dev-helper.sh b/recipes-connectivity/kuksa-val/can-dev-helper/can-dev-helper.sh index de9894d7..69dc6283 100644 --- a/recipes-connectivity/kuksa-val/can-dev-helper/can-dev-helper.sh +++ b/recipes-connectivity/kuksa-val/can-dev-helper/can-dev-helper.sh @@ -15,6 +15,9 @@ vcan_up() { } CONF=/etc/kuksa-dbc-feeder/config.ini +if [ $# -gt 0 ]; then + CONF=$1 +fi if [ ! -f $CONF ]; then exit 0 diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin.bb b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin.bb new file mode 100644 index 00000000..0a86cbbb --- /dev/null +++ b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin.bb @@ -0,0 +1,34 @@ +SUMMARY = "Demo LIN configuration for DBC feeder for KUKSA.val" +HOMEPAGE = "https://github.com/eclipse/kuksa.val" +BUGTRACKER = "https://github.com/eclipse/kuksa.val/issues" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +SRC_URI += "file://config-sllin.ini \ + file://kuksa-dbc-feeder-sllin.service \ +" + +inherit allarch systemd + +SYSTEMD_SERVICE:${PN} = "${BPN}.service" + +do_install() { + # NOTE: Installing into same /etc directory as the main configuration for now, + # this may be worth re-evaluating at some point (e.g. splitting the DBC + # files, having a dedicated token, etc.). + install -d ${D}${sysconfdir}/kuksa-dbc-feeder + install -m 0644 ${WORKDIR}/config-sllin.ini ${D}${sysconfdir}/kuksa-dbc-feeder/ + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/kuksa-dbc-feeder-sllin.service ${D}${systemd_system_unitdir} + fi +} + +FILES:${PN} += "${systemd_system_unitdir}" + +RDEPENDS:${PN} += " \ + kuksa-dbc-feeder \ + can-dev-helper \ + sllin-demo \ +" diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/config-sllin.ini b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/config-sllin.ini new file mode 100644 index 00000000..66980cb5 --- /dev/null +++ b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/config-sllin.ini @@ -0,0 +1,15 @@ +[kuksa_val] +# kuksa VSS server address +server=wss://localhost:8090 +# JWT security token file +token=/etc/kuksa-dbc-feeder/dbc_feeder.json.token +# VSS mapping file +mapping=/etc/kuksa-dbc-feeder/mapping.yml + +[can] +# CAN port +port=sllin0 +#Enable SAE-J1939 Mode. False: ignore +j1939=False +# DBC file used to parse CAN messages +dbcfile=/etc/kuksa-dbc-feeder/agl-vcar.dbc diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/kuksa-dbc-feeder-sllin.service b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/kuksa-dbc-feeder-sllin.service new file mode 100644 index 00000000..8f830de7 --- /dev/null +++ b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/kuksa-dbc-feeder-sllin.service @@ -0,0 +1,12 @@ +[Unit] +Description=Eclipse KUKSA.val DBC feeder (sllin0) +Requires=kuksa-val.service sllin-demo.service +After=kuksa-val.service sllin-demo.service + +[Service] +ExecStartPre=/usr/sbin/can-dev-helper.sh /etc/kuksa-dbc-feeder/config-sllin.ini +ExecStart=/usr/bin/dbcfeeder.py --config /etc/kuksa-dbc-feeder/config-sllin.ini +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/mapping.yml b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/mapping.yml index a493168d..f8a561d2 100644 --- a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/mapping.yml +++ b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/mapping.yml @@ -10,3 +10,86 @@ PT_EngineSpeed: Vehicle.Powertrain.CombustionEngine.Engine.Speed: transform: math: "floor(x+0.5)" + +SW_Next: + minupdatedelay: 500 + targets: + Vehicle.Cabin.Infotainment.Media.Action: + transform: + fullmapping: + 1: "SkipForward" + +SW_Previous: + minupdatedelay: 500 + targets: + Vehicle.Cabin.Infotainment.Media.Action: + transform: + fullmapping: + 1: "SkipBackward" + +# NOTE: Dependent on AGL-specific VSS overlay adding the extra action +SW_Mode: + minupdatedelay: 500 + targets: + Vehicle.Cabin.Infotainment.Media.Action: + transform: + fullmapping: + 1: "NextSource" + +# NOTE: Dependent on AGL-specific VSS overlay adding the signal +SW_Info: + minupdatedelay: 500 + targets: + Vehicle.Cabin.Infotainment.Cluster.Mode: + transform: + fullmapping: + 1: "true" + +# +# The following is a little hackish, due to relying on the +# application to treat IsActive and IsSet = "true" as toggles, and +# being dependent on the AGL-specific VSS overlay to add IsSet. +# A standalone LIN feeder with some state knowledge would maybe +# be cleaner. Another possible option would be the addition of +# another type of transform that has state to the DBC feeder. +# + +SW_CruiseEnable: + minupdatedelay: 500 + targets: + Vehicle.ADAS.CruiseControl.IsActive: + transform: + fullmapping: + 1: "true" + +SW_CruiseSet: + minupdatedelay: 500 + targets: + Vehicle.ADAS.CruiseControl.IsSet: + transform: + fullmapping: + 1: "true" + +SW_CruiseResume: + minupdatedelay: 500 + targets: + Vehicle.ADAS.CruiseControl.IsSet: + transform: + fullmapping: + 1: "true" + +SW_CruiseCancel: + minupdatedelay: 500 + targets: + Vehicle.ADAS.CruiseControl.IsSet: + transform: + fullmapping: + 1: "false" + +SW_LaneDepartureWarning: + minupdatedelay: 500 + targets: + Vehicle.ADAS.LaneDepartureDetection.IsActive: + transform: + fullmapping: + 1: "true" |