diff options
-rw-r--r-- | doc/ApplicationGuide.md | 2 | ||||
-rw-r--r-- | src/app.cpp | 5 |
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"); } |