summaryrefslogtreecommitdiffstats
path: root/src/obd2.h
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-02-16 16:09:08 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2017-02-16 16:10:14 +0000
commitd6d322103eaf1d2d5a1a94a0720a01a692f6a134 (patch)
treed2086d32c7203db7ff9de9984b79f74b4bbb41c3 /src/obd2.h
parent109ba77a295811c5037c2c4dfc618c3f7e047228 (diff)
Changing CanBus_c to can_bus_t class name
Change-Id: Ibf277e36187b78853718f76552ff730d0474a3e6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/obd2.h')
-rw-r--r--src/obd2.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/obd2.h b/src/obd2.h
index 61cb70c3..cd362c79 100644
--- a/src/obd2.h
+++ b/src/obd2.h
@@ -50,7 +50,6 @@ const char *UNIT_NAMES[10] = {
"NM"
};
-
/*
* A representation of an OBD-II PID.
*
@@ -63,7 +62,6 @@ const char *UNIT_NAMES[10] = {
* when automatic, recurring OBD-II requests are enabled.
* supported - is it supported by the vehicle. Initialized after scan
* event - application framework event handler.
- *
*/
typedef struct _Obd2Pid {
uint8_t pid;
@@ -116,7 +114,7 @@ float handleObd2Pid(const DiagnosticResponse* response, float parsedPayload);
* Object to handle obd2 session with pre-scan of supported pid
* then request them regularly
*/
-class Obd2Handler_c {
+class obd2_handler_c {
private:
public:
@@ -145,7 +143,31 @@ class Obd2Handler_c {
{ pid: 0x63, name: "obd2.engine.torque", min: 0, max: 65535, unit: NM, frequency: 1, supported: false },
};
- Obd2Handler_c();
- bool isObd2Request(request);
-}
+ /* Public: Check if a request is an OBD-II PID request.
+ *
+ * Returns true if the request is a mode 1 request and it has a 1 byte PID.
+ */
+ void find_obd2_pid(const char *name, std::Vector<Obd2Pid> *pids);
+
+ /* Public: Check if a request is an OBD-II PID request.
+ *
+ * Returns true if the request is a mode 1 request and it has a 1 byte PID.
+ */
+ bool is_obd2_request(DiagnosticRequest *request);
+
+ /*
+ * Public: Check if requested signal name is an obd2 pid
+ *
+ * Returns true if name began with ob2.* else false.
+ */
+ bool is_obd2_signal(const char *name);
+
+ /*
+ * Public: pass response to UDS-C library function
+ * diagnostic_decode_obd2_pid()
+ *
+ * Return: float number representing the requested value.
+ */
+ bool decode_obd2_response(DiagnosticResponse* responce);
+} \ No newline at end of file