File tree Expand file tree Collapse file tree
src/main/java/com/pnuema/android/obd Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ wrapper {
44}
55
66buildscript {
7- ext. kotlin_version = ' 1.4.20 '
7+ ext. kotlin_version = ' 1.4.21 '
88 repositories {
99 google()
1010 jcenter()
Original file line number Diff line number Diff line change 11apply plugin : ' com.android.library'
22apply plugin : ' kotlin-android'
3- apply plugin : ' kotlin-android-extensions'
43apply plugin : ' kotlin-kapt'
54apply plugin : ' kotlinx-serialization'
65apply plugin : ' maven'
@@ -47,7 +46,7 @@ android {
4746dependencies {
4847 implementation ' com.udojava:EvalEx:2.5'
4948 implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version "
50- implementation ' org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.0 '
49+ implementation ' org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1 '
5150 implementation " androidx.startup:startup-runtime:1.0.0"
5251}
5352
Original file line number Diff line number Diff line change 1212 */
1313package com.pnuema.android.obd.enums
1414
15+ import java.lang.Long.parseLong
16+
1517/* *
1618 * All OBD modes.
1719 *
@@ -69,5 +71,9 @@ enum class ObdModes constructor(val value: Char) {
6971 MODE_0A (' A' );
7072
7173 val intValue: Int
72- get() = Character .digit(value, 16 )
74+ get() = parseLong(value.toString(), 16 ).toInt()
75+
76+ override fun toString (): String {
77+ return value.toString()
78+ }
7379}
Original file line number Diff line number Diff line change @@ -37,4 +37,6 @@ data class DTC (
3737
3838 return this
3939 }
40+
41+ val modeString get() = mode.trimStart(' 0' )
4042}
You can’t perform that action at this time.
0 commit comments