Update VIS vehicle signal support 51/27651/1
authorScott Murray <scott.murray@konsulko.com>
Sun, 12 Jun 2022 16:37:16 +0000 (12:37 -0400)
committerScott Murray <scott.murray@konsulko.com>
Mon, 4 Jul 2022 21:20:40 +0000 (21:20 +0000)
Rework to change the VIS signals being used for next/previous/mode
to new AGL custom steering wheel switch signals instead of trying
to use the Vehicle.Cabin.Infotainment.Media.Action actuator signal.
In practice mapping multiple CAN signals from the LIN polling to a
single VIS signal does not work well with the behavior of the CAN
feeder from KUKSA.val.  With the separate steering wheel switch
signals and duplicate filtering in libqtappfw, things look more
like they did with signal-composer and should hopefully be robust.
This should be revisited if a custom LIN signal feeder becomes an
option, as overall it would be better to leverage the standard VSS
schema signals if possible.

Bug-AGL: SPEC-4409

Change-Id: I73512ba9c5746e820fc30a316a39db371d98f5e3
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
(cherry picked from commit 81ad8d4aca06b27d9c57730a7dead6e8e5ae1fd1)

app/MediaPlayer.qml

index 95bc22b..03c85c4 100644 (file)
@@ -96,21 +96,21 @@ ApplicationWindow {
         }
 
         onAuthorized: {
-           VehicleSignals.subscribe("Vehicle.Cabin.Infotainment.Media.Action")
+           VehicleSignals.subscribe("Vehicle.Cabin.SteeringWheel.Switches.Next")
+           VehicleSignals.subscribe("Vehicle.Cabin.SteeringWheel.Switches.Previous")
+           VehicleSignals.subscribe("Vehicle.Cabin.SteeringWheel.Switches.Mode")
        }
 
         onSignalNotification: {
-            if (path === "Vehicle.Cabin.Infotainment.Media.Action") {
-                if (value == "SkipForward") {
-                    mediaplayer.next()
-                } else if (value == "SkipBackward") {
-                    mediaplayer.previous()
-                } else if (value == "NextSource") {
-                    if (player.av_connected)
-                        mediaplayer.connect()
-                    else
-                        mediaplayer.disconnect()
-                }
+            if (path === "Vehicle.Cabin.SteeringWheel.Switches.Next" && value === "true") {
+                mediaplayer.next()
+            } else if (path === "Vehicle.Cabin.SteeringWheel.Switches.Previous" && value === "true") {
+                mediaplayer.previous()
+            } else if (path === "Vehicle.Cabin.SteeringWheel.Switches.Mode" && value === "true") {
+                if (player.av_connected)
+                    mediaplayer.connect()
+                else
+                    mediaplayer.disconnect()
             }
         }
     }