Woman, Life, Freedom |
|
OBD-II Emulator
Linux ODB-II Emulator public and protected interfaces documentation
|
A class that defines an OBD-II service based on SAE J1979 standard. More...
#include <obd_service.h>
Public Types | |
| using | CallbackType = std::function< void(const std::vector< uint8_t > &, std::vector< uint8_t > &&, uint8_t)> |
| Response ready callback type. | |
Public Member Functions | |
| uint8_t | GetService () const noexcept |
| Get the service. More... | |
| void | SetCallback (CallbackType &&callback) |
| Set the response ready callback. More... | |
| 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. More... | |
| virtual bool | TryGetResponseAsync (const std::vector< uint8_t > &pid)=0 |
| Try to get an emulated response asynchronously based the queried PID. More... | |
| void | ResetCallback () noexcept |
| Reset the response ready callback. | |
Protected Types | |
| using | InternalCallbackType = std::function< void(const std::vector< uint8_t > &, std::vector< uint8_t > &&)> |
| Service specific response ready callback type. | |
Protected Member Functions | |
| ObdService (uint8_t service) noexcept | |
| Constructor. More... | |
Protected Attributes | |
| InternalCallbackType | Callback |
A class that defines an OBD-II service based on SAE J1979 standard.
|
protectednoexcept |
Constructor.
| service | OBD-II service (mode) |
|
noexcept |
Get the service.
| void ObdEmulator::ObdService::SetCallback | ( | CallbackType && | callback | ) |
Set the response ready callback.
| callback | Callback to be invoked when the response is ready |
|
pure virtual |
Try to get an emulated response based the queried PID.
| [in] | pid | Queried PID |
| [out] | response | Response data byte array |
|
pure virtual |
Try to get an emulated response asynchronously based the queried PID.
| pid | Queried PID |