Skip to content

Conversation

@Corwin-Kh
Copy link
Contributor

No description provided.

LIVE(0x41), FREEZE(0x42), IDENTIFICATION(0x49)
}

private val sideDataToRemoveFromAnswer = arrayOf(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs better name

val connection = Obd2Connection(createTransport(), this)
try {
while (isConnected(connection)) {
var connectedScannerIsStopped = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whole logics related to OBDResponse.STOPPED needs to be explained.

}

private fun normalizeResponseString(fullCommand: String, response: String): String {
var response1 = response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use response1 like names

Comment on lines +269 to +275
boolean isOBDDevice = device instanceof BLEOBDDevice;
if (isOBDDevice && vehicleMetricsPlugin != null || !isOBDDevice && externalSensorsPlugin != null) {
devices.put(device.getDeviceId(), device);
if (isOBDDevice && vehicleMetricsPlugin != null) {
vehicleMetricsPlugin.onBLEDeviceFound((BLEOBDDevice) device);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be refactored!!!

Comment on lines 451 to 459
if (device instanceof BLEOBDDevice) {
((BLEOBDDevice) device).setDeviceReadyListener(new BLEOBDDevice.DeviceReadyListener() {
@Override
public void onDeviceReadyStateChange(boolean isReady) {
VehicleMetricsPlugin vehicleMetricsPlugin = PluginsHelper.getPlugin(VehicleMetricsPlugin.class);
vehicleMetricsPlugin.connectToDevice((BLEOBDDevice) device);
}
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be refactored!!!

}

@Nullable
protected List<BluetoothGattCharacteristic> cachedCharacteristics;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insert fields at top of the class!

cachedCharacteristics?.let {
}
}
log.debug("Відправлено команду: $command; result $res")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write logs in english only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants