LowCanClient can receive accelerator.pedal.position signal
[apps/agl-service-windowmanager.git] / src / main.cpp
index 7abdfb0..99e7a7c 100644 (file)
@@ -683,6 +683,24 @@ void on_event(const char *event, struct json_object *object){
                 }
             });
         }
+        if (g_afb_instance->lcc_.isChangedAccelPedalState()) {
+            // If accelerator pedal state is changed
+            HMI_DEBUG("wm", "Accelerator Pedal state is changed");
+
+            // Get parking brake state
+            const char* accel_pedal_state = g_afb_instance->lcc_.getCurrentAccelPedalState();
+
+#if 0 // TODO: PolicyManager can not use accelerator pedal state
+            // Allocate window resource
+            g_afb_instance->app.allocateWindowResource(accel_pedal_state, nullptr,
+                                                       nullptr, nullptr,
+                                                       [](const char* errmsg){
+                if (errmsg != nullptr) {
+                    HMI_ERROR("wm", errmsg);
+                }
+            });
+#endif
+        }
         else if (g_afb_instance->lcc_.isChangedCarState()) {
             // If car state is changed
             HMI_DEBUG("wm", "Car state is changed");