WIP color fixes

This commit is contained in:
Kevin Hester
2021-05-09 09:02:53 +08:00
parent 18d526166f
commit 59e430d30d
15 changed files with 45 additions and 64 deletions

View File

@@ -279,7 +279,9 @@ class MeshService : Service(), Logging {
@param requireConnected set to false if you are okay with using a partially connected device (i.e. during startup)
*/
private fun sendToRadio(p: ToRadio.Builder, requireConnected: Boolean = true) {
val b = p.build().toByteArray()
val built = p.build()
debug("Sending to radio $built")
val b = built.toByteArray()
if (SoftwareUpdateService.isUpdating)
throw IsUpdatingException()
@@ -1793,8 +1795,9 @@ class MeshService : Service(), Logging {
toRemoteExceptions {
// Init from and id
myNodeID?.let { myId ->
if (p.from == DataPacket.ID_LOCAL)
p.from = myId
// we no longer set from, we let the device do it
//if (p.from == DataPacket.ID_LOCAL)
// p.from = myId
if (p.id == 0)
p.id = generatePacketId()

View File

@@ -685,10 +685,10 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
gatt?.writeCharacteristic(c) ?: false
}
/* fun asyncWriteReliable(
fun asyncWriteReliable(
c: BluetoothGattCharacteristic,
cb: (Result<Unit>) -> Unit
) = queueWriteCharacteristic(c, CallbackContinuation(cb)) */
) = queueWriteReliable(c, CallbackContinuation(cb))
fun writeReliable(c: BluetoothGattCharacteristic): Unit =
makeSync { queueWriteReliable(c, it) }