14 const uint8_t mService;
18 using CallbackType = std::function<void(
const std::vector<uint8_t> &, std::vector<uint8_t> &&, uint8_t)>;
47 const std::vector<uint8_t> &pid,
48 std::vector<uint8_t> &response) const = 0;
55 const std::vector<uint8_t> &pid) = 0;
A class that defines an OBD-II service based on SAE J1979 standard.
Definition: obd_service.h:12
virtual bool TryGetResponse(const std::vector< uint8_t > &pid, std::vector< uint8_t > &response) const =0
Try to get an emulated response based the queried PID.
std::function< void(const std::vector< uint8_t > &, std::vector< uint8_t > &&)> InternalCallbackType
Service specific response ready callback type.
Definition: obd_service.h:26
virtual bool TryGetResponseAsync(const std::vector< uint8_t > &pid)=0
Try to get an emulated response asynchronously based the queried PID.
void ResetCallback() noexcept
Reset the response ready callback.
void SetCallback(CallbackType &&callback)
Set the response ready callback.
uint8_t GetService() const noexcept
Get the service.
std::function< void(const std::vector< uint8_t > &, std::vector< uint8_t > &&, uint8_t)> CallbackType
Response ready callback type.
Definition: obd_service.h:18
ObdService(uint8_t service) noexcept
Constructor.