From 351391b2f6becfc0d64f6376396afaaa7e668672 Mon Sep 17 00:00:00 2001 From: Yuta Doi Date: Tue, 22 May 2018 10:21:17 +0900 Subject: getCarInfo() can get lightstatus.brake status getCarInfo() can get also the lightstatus brake as follows: - lightstatus brake : true/false The details are described in doc/ApplicationGuide.md in project apps/agl-service-windowmanager-2017. Change-Id: I29b2c5b4fe129407c3b304b2fa981cbd3f4b6847 Signed-off-by: Yuta Doi --- doc/ApplicationGuide.md | 2 ++ src/app.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/doc/ApplicationGuide.md b/doc/ApplicationGuide.md index 9c19b69..5034c8a 100644 --- a/doc/ApplicationGuide.md +++ b/doc/ApplicationGuide.md @@ -608,6 +608,7 @@ but only has difference of 1st argument. **args2: `{ }`** This function gets the information of car by the application as follows: - parking brake state +- lightstatus brake (foot brake) state - accelerator pedal position - car state @@ -616,6 +617,7 @@ It outputs the car information for json_object in the 2nd argument as follows: | in_obj | out_obj | |:------------------------------------------|:------------------------------------| | { "label": "parking_brake_status" } | {"value": json_bool (true/false)} | +| { "label": "lightstatus.brake" } | {"value": json_bool (true/false)} | | { "label": "accelerator.pedal.position" } | {"value": double (0 - 127.5)} | | { "label": "car_state" } | {"value": const char* (stop/run)} | diff --git a/src/app.cpp b/src/app.cpp index 1d6b504..f457d09 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -880,6 +880,11 @@ result App::api_get_car_info(char const *label) { const char* val = this->crr_car_info_.car_stt; j_in = json_object_new_string(val); } + else if (0 == strcmp("lightstatus.brake", label)) { + // Get lightstatus brake status + json_bool val = this->crr_car_info_.lightstatus_brake_stt; + j_in = json_object_new_boolean(val); + } else { return Err("Car info does not exist"); } -- cgit 1.2.3-korg