Added negative elevation filtering when sent via BT/Network (#164)

This commit is contained in:
Arty Bishop committed 2025-09-07 15:22:06 +01:00
1 parent c0debc038a
commit c910e37d00
13 files changed
+49 -19

No files matched your search

@@ -23,7 +23,6 @@ class BTReporter(private val manager: BluetoothManager, private val reporterScop
fun isConnecting(): Boolean = connecting
@Suppress("BlockingMethodInNonBlockingContext")
fun connectBTDevice(deviceId: String) {
if (!connected) {
rotationConnectionJob = reporterScope.launch {
@@ -47,13 +46,13 @@ class BTReporter(private val manager: BluetoothManager, private val reporterScop
}
}
@Suppress("BlockingMethodInNonBlockingContext")
fun reportRotation(format: String, azimuth: Int, elevation: Int) {
if (connected) {
rotationReportingJob = reporterScope.launch {
val newElevation = if (elevation > 0) elevation else 0
try {
val azimuthString = intToStringWithLeadingZeroes(azimuth)
val elevationString = intToStringWithLeadingZeroes(elevation)
val elevationString = intToStringWithLeadingZeroes(newElevation)
val crChar = '\r'
val nlChar = '\n'
val tbChar = '\t'