Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import net.osmand.plus.plugins.externalsensors.devices.ble.BLEAbstractDevice;
import net.osmand.plus.plugins.externalsensors.devices.ble.BLEBPICPDevice;
import net.osmand.plus.plugins.externalsensors.devices.ble.BLEBikeSCDDevice;
import net.osmand.plus.plugins.externalsensors.devices.ble.BLECarlyDevice;
import net.osmand.plus.plugins.externalsensors.devices.ble.BLEHeartRateDevice;
import net.osmand.plus.plugins.externalsensors.devices.ble.BLEOBDDevice;
import net.osmand.plus.plugins.externalsensors.devices.ble.BLERunningSCDDevice;
Expand Down Expand Up @@ -85,6 +86,7 @@ public abstract class DevicesHelper implements DeviceListener, DevicePreferences

private final static List<UUID> SUPPORTED_BLE_SERVICE_UUIDS = Arrays.asList(
BLEOBDDevice.Companion.getServiceUUID(),
BLECarlyDevice.Companion.getServiceUUID(),
BLEBikeSCDDevice.getServiceUUID(),
BLEHeartRateDevice.getServiceUUID(),
BLERunningSCDDevice.getServiceUUID(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public class GattAttributes {
public static final String CHARACTERISTIC_OBD_WRITE = "0000fff2-0000-1000-8000-00805f9b34fb";
public static final UUID UUID_CHARACTERISTIC_OBD_WRITE = UUID.fromString(CHARACTERISTIC_OBD_WRITE);

public static final String CHARACTERISTIC_OBD_CARLY_SCANNER = "00000000-0000-0000-0000-001a2201b4a7";
public static final UUID UUID_CHARACTERISTIC_OBD_CARLY_SCANNER = UUID.fromString(CHARACTERISTIC_OBD_CARLY_SCANNER);

static {
SUPPORTED_CHARACTERISTICS.add(UUID.fromString(CHARACTERISTIC_CYCLING_SPEED_AND_CADENCE_MEASUREMENT));
SUPPORTED_CHARACTERISTICS.add(UUID.fromString(CHARACTERISTIC_HEART_RATE_MEASUREMENT));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public static BLEAbstractDevice createDeviceByUUID(@NonNull BluetoothAdapter blu
@NonNull UUID uuid, @NonNull String address,
@NonNull String name, int rssi) {
BLEAbstractDevice device = null;
if (BLEOBDDevice.Companion.getServiceUUID().equals(uuid)) {
if (BLECarlyDevice.Companion.getServiceUUID().equals(uuid)) {
device = new BLECarlyDevice(bluetoothAdapter, address);
} else if (BLEOBDDevice.Companion.getServiceUUID().equals(uuid)) {
device = new BLEOBDDevice(bluetoothAdapter, address);
} else if (BLEHeartRateDevice.getServiceUUID().equals(uuid)) {
device = new BLEHeartRateDevice(bluetoothAdapter, address);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package net.osmand.plus.plugins.externalsensors.devices.ble

import android.bluetooth.BluetoothAdapter
import net.osmand.plus.plugins.externalsensors.GattAttributes
import java.util.UUID

class BLECarlyDevice(bluetoothAdapter: BluetoothAdapter, deviceId: String) :
BLEOBDDevice(bluetoothAdapter, deviceId) {
companion object {
val serviceUUID: UUID
get() = GattAttributes.UUID_CHARACTERISTIC_OBD_CARLY_SCANNER
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import okio.Timeout
import java.util.UUID
import kotlin.math.min

class BLEOBDDevice(bluetoothAdapter: BluetoothAdapter, deviceId: String) :
open class BLEOBDDevice(bluetoothAdapter: BluetoothAdapter, deviceId: String) :
BLEAbstractDevice(bluetoothAdapter, deviceId), Source, Sink {
private val log = PlatformUtil.getLog("OBD2")

Expand Down
Loading