summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Granata2017-03-28 12:36:16 -0500
committerEnrico Granata2017-04-04 15:16:33 -0500
commitfb08d625fe193d018a18abb2d3ffd71818419eb8 (patch)
treeeb12badb2e228979ede1fea25f9709eb3842faca /obd2-lib
parentf50230d087f356300957af2317b4b0f4df6631e6 (diff)
downloadplatform-packages-services-car-fb08d625fe193d018a18abb2d3ffd71818419eb8.tar.gz
platform-packages-services-car-fb08d625fe193d018a18abb2d3ffd71818419eb8.tar.xz
platform-packages-services-car-fb08d625fe193d018a18abb2d3ffd71818419eb8.zip
Phone app to collect data from a Bluetooth OBD2 dongle via obd2_lib
Test: manual testing with a Vgate Scan and a Nexus 5X Change-Id: I26d7f7e80b06eb067869ade2d7edb5e22c23731a
Diffstat (limited to 'obd2-lib')
-rw-r--r--obd2-lib/src/com/android/car/obd2/Obd2Connection.java4
-rw-r--r--obd2-lib/src/com/android/car/obd2/Obd2LiveFrameGenerator.java10
2 files changed, 14 insertions, 0 deletions
diff --git a/obd2-lib/src/com/android/car/obd2/Obd2Connection.java b/obd2-lib/src/com/android/car/obd2/Obd2Connection.java
index bfdb9c0f..577b7989 100644
--- a/obd2-lib/src/com/android/car/obd2/Obd2Connection.java
+++ b/obd2-lib/src/com/android/car/obd2/Obd2Connection.java
@@ -72,6 +72,10 @@ public class Obd2Connection {
72 return true; 72 return true;
73 } 73 }
74 74
75 public boolean isConnected() {
76 return mConnection.isConnected();
77 }
78
75 static int toDigitValue(char c) { 79 static int toDigitValue(char c) {
76 if ((c >= '0') && (c <= '9')) return c - '0'; 80 if ((c >= '0') && (c <= '9')) return c - '0';
77 switch (c) { 81 switch (c) {
diff --git a/obd2-lib/src/com/android/car/obd2/Obd2LiveFrameGenerator.java b/obd2-lib/src/com/android/car/obd2/Obd2LiveFrameGenerator.java
index 121b54aa..3fffd22b 100644
--- a/obd2-lib/src/com/android/car/obd2/Obd2LiveFrameGenerator.java
+++ b/obd2-lib/src/com/android/car/obd2/Obd2LiveFrameGenerator.java
@@ -56,6 +56,16 @@ public class Obd2LiveFrameGenerator {
56 mFloatCommands.add( 56 mFloatCommands.add(
57 Obd2Command.getLiveFrameCommand( 57 Obd2Command.getLiveFrameCommand(
58 Obd2Command.getFloatCommand(pid)))); 58 Obd2Command.getFloatCommand(pid))));
59 Log.i(
60 TAG,
61 String.format(
62 "connectionPids = %s\napiIntegerPids=%s\napiFloatPids = %s\n"
63 + "mIntegerCommands = %s\nmFloatCommands = %s\n",
64 connectionPids,
65 apiIntegerPids,
66 apiFloatPids,
67 mIntegerCommands,
68 mFloatCommands));
59 } 69 }
60 70
61 public JsonWriter generate(JsonWriter jsonWriter) throws IOException { 71 public JsonWriter generate(JsonWriter jsonWriter) throws IOException {