mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
add option to request remote nodes position
This commit is contained in:
parent
8a03603ef8
commit
6894883362
6 changed files with 43 additions and 13 deletions
|
|
@ -152,10 +152,6 @@ class UIViewModel @Inject constructor(
|
|||
|
||||
fun sendMessage(str: String, channel: Int = 0, dest: String = DataPacket.ID_BROADCAST) {
|
||||
val p = DataPacket(dest, channel, str)
|
||||
sendDataPacket(p)
|
||||
}
|
||||
|
||||
fun sendDataPacket(p: DataPacket) {
|
||||
try {
|
||||
meshService?.send(p)
|
||||
} catch (ex: RemoteException) {
|
||||
|
|
@ -163,6 +159,14 @@ class UIViewModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
fun requestPosition(destNum: Int) {
|
||||
try {
|
||||
meshService?.requestPosition(destNum)
|
||||
} catch (ex: RemoteException) {
|
||||
errormsg("Request position error: ${ex.message}")
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteAllLogs() = viewModelScope.launch(Dispatchers.IO) {
|
||||
meshLogRepository.deleteAll()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue