mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-05 16:22:32 -08:00
Write serial directly on Android
This commit is contained in:
1 file changed
+2
-2
@@ -223,7 +223,7 @@ class AndroidSerialHandler(val activity: AppCompatActivity) :
|
||||
@Synchronized
|
||||
private fun writeSerial(serialText: String, print: Boolean = false) {
|
||||
try {
|
||||
usbIoManager?.writeAsync("${serialText}\n".toByteArray())
|
||||
currentPort?.port?.write("${serialText}\n".toByteArray(), 0)
|
||||
if (print) {
|
||||
addLog("-> $serialText\n")
|
||||
}
|
||||
@@ -272,7 +272,7 @@ class AndroidSerialHandler(val activity: AppCompatActivity) :
|
||||
}
|
||||
|
||||
override fun write(buff: ByteArray) {
|
||||
usbIoManager?.writeAsync(buff)
|
||||
currentPort?.port?.write(buff, 0)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
|
||||
Reference in new issue
Block a user