diff options
author | Yuta Doi <yuta-d@witz-inc.co.jp> | 2018-05-09 13:34:19 +0900 |
---|---|---|
committer | Yuta Doi <yuta-d@witz-inc.co.jp> | 2018-05-09 13:34:19 +0900 |
commit | a660fd2bc4e232dd8bb61febd1eae1e26d674804 (patch) | |
tree | 36362f2462d4eb37d3b5eacf300896e4d3c1c5e1 /src/main.cpp | |
parent | a98320a337645609da7060b20478969196cc2f4e (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.cpp | 18 |
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"); |