forked from Blendman974/faceclaw
Forward ring input events before filtering, and include swipe info
This commit is contained in:
1 parent
b972cd7682
commit
7b19c00443
20 files changed
+368
-75
No files matched your search
+4
@@ -12,6 +12,10 @@ interface FaceclawBleCommunicatorListener {
|
||||
eventSource: Int,
|
||||
systemExitReasonCode: Int,
|
||||
frameId: Int,
|
||||
ringTick: Long,
|
||||
ringType: Int,
|
||||
ringAux: Int,
|
||||
ringSpeed: Int,
|
||||
): Unit
|
||||
|
||||
fun onBatteryState(
|
||||
|
||||
@@ -75,12 +75,31 @@ class G2Event {
|
||||
z,
|
||||
)
|
||||
}
|
||||
return G2Event("sys-event", "", eventType, eventSource, exitReason)
|
||||
return G2Event("sys-event", "", eventType, eventSource, exitReason).apply {
|
||||
// Faceclaw/19 SysEvent field 100: RI/v1 + raw R1 metadata.
|
||||
val raw = BleProtocol.readFieldBytes(sysEvent, 100)
|
||||
if (eventSource == 2 && raw != null && raw.size == 12 &&
|
||||
raw[0] == 0x52.toByte() && raw[1] == 0x49.toByte() &&
|
||||
raw[2] == 1.toByte() && raw[3] == 1.toByte() && raw[7] == 0.toByte()) {
|
||||
ringTick = (0..3).fold(0L) { tick, i ->
|
||||
tick or ((raw[8 + i].toLong() and 255L) shl (8 * i))
|
||||
}
|
||||
ringType = raw[4].toInt() and 255
|
||||
ringAux = raw[5].toInt() and 255
|
||||
ringSpeed = raw[6].toInt() and 255
|
||||
}
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/** -1 means no original ring timestamp (stock/legacy/synthetic input). */
|
||||
@JvmField var ringTick: Long = -1
|
||||
@JvmField var ringType: Int = 0
|
||||
@JvmField var ringAux: Int = 0
|
||||
@JvmField var ringSpeed: Int = 0
|
||||
|
||||
@JvmField val kind: String
|
||||
|
||||
@JvmField val containerName: String
|
||||
|
||||
Reference in new issue
Block a user