aboutsummaryrefslogtreecommitdiffstats
path: root/src/obd2/obd2.c
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-17 15:56:34 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-17 15:56:34 -0500
commit6ebad2aac3ba2f0d7ff5e37c5db4e5b9549247e2 (patch)
treefcec8eae39587e50054fb627eee3662acb7809b3 /src/obd2/obd2.c
parent648c2f77afd1dadce1c01de3f1dc42b54da656d0 (diff)
Mark whether a PID is present in response.
Diffstat (limited to 'src/obd2/obd2.c')
-rw-r--r--src/obd2/obd2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/obd2/obd2.c b/src/obd2/obd2.c
index 5b282f1..5061dd6 100644
--- a/src/obd2/obd2.c
+++ b/src/obd2/obd2.c
@@ -154,9 +154,9 @@ static bool handle_positive_response(DiagnosticRequestHandle* handle,
// hide the "response" version of the mode from the user
// if it matched
response->mode = handle->request.mode;
- bool has_pid = false;
+ response->has_pid = false;
if(handle->request.pid_length > 0 && message->size > 1) {
- has_pid = true;
+ response->has_pid = true;
if(handle->request.pid_length == 2) {
response->pid = get_bitfield(message->payload, message->size,
PID_BYTE_INDEX * CHAR_BIT, sizeof(uint16_t) * CHAR_BIT);
@@ -173,7 +173,7 @@ static bool handle_positive_response(DiagnosticRequestHandle* handle,
response->payload_length);
}
- if((handle->request.pid_length == 0 && !has_pid)
+ if((handle->request.pid_length == 0 && !response->has_pid)
|| response->pid == handle->request.pid) {
response->success = true;
response->completed = true;