summaryrefslogtreecommitdiffstats
path: root/src/diagnostic/active-diagnostic-request.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/diagnostic/active-diagnostic-request.cpp')
-rw-r--r--src/diagnostic/active-diagnostic-request.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/diagnostic/active-diagnostic-request.cpp b/src/diagnostic/active-diagnostic-request.cpp
index fcdbc97..4f28866 100644
--- a/src/diagnostic/active-diagnostic-request.cpp
+++ b/src/diagnostic/active-diagnostic-request.cpp
@@ -22,6 +22,8 @@
#include "../configuration.hpp"
+#define ERROR_PID 0xFF
+
std::string active_diagnostic_request_t::prefix_ = "diagnostic_messages";
bool active_diagnostic_request_t::operator==(const active_diagnostic_request_t& b)
@@ -73,6 +75,13 @@ const std::shared_ptr<can_bus_dev_t> active_diagnostic_request_t::get_can_bus_de
return can_bus_t::get_can_device(bus_);
}
+uint16_t active_diagnostic_request_t::get_pid() const
+{
+ if (handle_->request.has_pid)
+ return handle_->request.pid;
+ return ERROR_PID;
+}
+
DiagnosticRequestHandle* active_diagnostic_request_t::get_handle()
{
return handle_;