aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-05-09 13:34:19 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-05-09 13:34:19 +0900
commita660fd2bc4e232dd8bb61febd1eae1e26d674804 (patch)
tree36362f2462d4eb37d3b5eacf300896e4d3c1c5e1 /src/main.cpp
parenta98320a337645609da7060b20478969196cc2f4e (diff)
Add parking brake ON/OFF event
Change-Id: I3b9face35972a275918ac4f95f4a97df035ee924 Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 067a006..7abdfb0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -667,7 +667,23 @@ void on_event(const char *event, struct json_object *object){
// Analyze low can signal
g_afb_instance->lcc_.analyzeCanSignal(object);
- if (g_afb_instance->lcc_.isChangedCarState()) {
+ if (g_afb_instance->lcc_.isChangedParkingBrakeState()) {
+ // If parking brake state is changed
+ HMI_DEBUG("wm", "Parking Brake state is changed");
+
+ // Get parking brake state
+ const char* parking_brake_state = g_afb_instance->lcc_.getCurrentParkingBrakeState();
+
+ // Allocate window resource
+ g_afb_instance->app.allocateWindowResource(parking_brake_state, nullptr,
+ nullptr, nullptr,
+ [](const char* errmsg){
+ if (errmsg != nullptr) {
+ HMI_ERROR("wm", errmsg);
+ }
+ });
+ }
+ else if (g_afb_instance->lcc_.isChangedCarState()) {
// If car state is changed
HMI_DEBUG("wm", "Car state is changed");