Skip to content
Merged
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
6 changes: 5 additions & 1 deletion app/src/main/java/com/dzid26/teslable/ble/TeslaGattClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ class TeslaGattClient(

@SuppressLint("MissingPermission")
override fun readRssi() {
// One GATT operation in flight: an RSSI read during setup or a chunk write would collide with it. The next
// poll picks the value up.
if (setupStep != SetupStep.DONE || writeInProgress) return
gatt?.readRemoteRssi()
}

Expand All @@ -108,7 +111,8 @@ class TeslaGattClient(
val chunk = writeQueue.removeFirstOrNull() ?: return

writeInProgress = true
// The Go reference writes with response; write without response is validated on a real car.
// The Go reference writes with response. We write without response: chunks are paced on
// onCharacteristicWrite, which fires for this type too, and it saves a round trip per chunk.
val started =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
gatt.writeCharacteristic(
Expand Down
Loading