mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
better
This commit is contained in:
parent
456014dd5f
commit
d2f6156841
4 changed files with 46 additions and 18 deletions
|
|
@ -120,6 +120,27 @@ class MainActivity : AppCompatActivity(), Logging {
|
|||
)
|
||||
}
|
||||
})
|
||||
|
||||
Button(text = "send packets",
|
||||
onClick = {
|
||||
// FIXME - don't do these operations until we are informed we have a connection, otherwise
|
||||
// the radio interface service might not yet be connected to the mesh service
|
||||
val m = meshService!!
|
||||
|
||||
// Do some test operations
|
||||
m.setOwner("+16508675309", "Kevin Xter", "kx")
|
||||
val testPayload = "hello world".toByteArray()
|
||||
m.sendData(
|
||||
"+16508675310",
|
||||
testPayload,
|
||||
MeshProtos.Data.Type.SIGNAL_OPAQUE_VALUE
|
||||
)
|
||||
m.sendData(
|
||||
"+16508675310",
|
||||
testPayload,
|
||||
MeshProtos.Data.Type.CLEAR_TEXT_VALUE
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -157,15 +178,6 @@ class MainActivity : AppCompatActivity(), Logging {
|
|||
val m = IMeshService.Stub.asInterface(service)
|
||||
meshService = m
|
||||
|
||||
// FIXME - don't do these operations until we are informed we have a connection, otherwise
|
||||
// the radio interface service might not yet be connected to the mesh service
|
||||
|
||||
// Do some test operations
|
||||
m.setOwner("+16508675309", "Kevin Xter", "kx")
|
||||
val testPayload = "hello world".toByteArray()
|
||||
m.sendData("+16508675310", testPayload, MeshProtos.Data.Type.SIGNAL_OPAQUE_VALUE)
|
||||
m.sendData("+16508675310", testPayload, MeshProtos.Data.Type.CLEAR_TEXT_VALUE)
|
||||
|
||||
// FIXME this doesn't work because the model has already been copied into compose land?
|
||||
// runOnUiThread { // FIXME - this can be removed?
|
||||
meshServiceState.connected = m.isConnected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue