aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-05-22 10:21:17 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-05-22 10:21:17 +0900
commit351391b2f6becfc0d64f6376396afaaa7e668672 (patch)
treed43e48a0c0ad31e6a40e7b9a53804f064469c9e7
parentcfcc176e4cbbd890bcd67e2b8afb61fbff10d131 (diff)
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 <yuta-d@witz-inc.co.jp>
-rw-r--r--doc/ApplicationGuide.md2
-rw-r--r--src/app.cpp5
2 files changed, 7 insertions, 0 deletions
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<json_object *> 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<json_object *>("Car info does not exist");
}