From dc8544794e26b056d758bd001ef90f93f2b91f9a Mon Sep 17 00:00:00 2001 From: Seb3thehacker Date: Mon, 2 Nov 2026 16:07:17 -0800 Subject: [PATCH] wireless: the version reply names the Wi-Fi channel type the car asked for Strict head units, Toyota's among them, wait for more than a bare status before they send the StartRequest. --- .../app/seb3thehacker/gearslip/wireless/WirelessLink.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/wireless/WirelessLink.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/wireless/WirelessLink.kt index b198003..32c607b 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/wireless/WirelessLink.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/wireless/WirelessLink.kt @@ -190,14 +190,18 @@ object WirelessLink { log.hex(" version", body) // Laid out the way a real phone's reply is (aa-proxy-rs and LIVI both // parse it from real phones): 1 and 2 the version, echoing the car's; - // 3 a serial; 4 the status; 6 the device's ids. + // 3 a serial; 4 the status; 5 the Wi-Fi channel type the car asked for; + // 6 the device's ids. Strict head units, such as Toyota's, hold back the + // StartRequest until the reply carries more than the status. val f = Wire.fields(body) val serial = deviceId(context) val ids = Protobuf.stringField(1, serial) + Protobuf.stringField(2, UUID.randomUUID().toString()) + val channelType = Wire.varint(f, 3) val reply = Protobuf.varintField(1, Wire.varint(f, 1) ?: 1) + Protobuf.varintField(2, Wire.varint(f, 2) ?: 0) + Protobuf.stringField(3, serial) + Protobuf.varintField(4, STATUS_SUCCESS) + + (channelType?.let { Protobuf.varintField(5, it) } ?: ByteArray(0)) + Protobuf.varint(((6 shl 3) or 2).toLong()) + Protobuf.varint(ids.size.toLong()) + ids send(output, MSG_VERSION_RESPONSE, reply) log.i("-> VersionResponse")