mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: enable remote admin to set/remove fixed_position
This commit is contained in:
parent
f8898def89
commit
852c6e1bc2
5 changed files with 35 additions and 34 deletions
|
|
@ -271,15 +271,15 @@ class RadioConfigViewModel @Inject constructor(
|
|||
"Request NodeDB reset error"
|
||||
)
|
||||
|
||||
fun setFixedPosition(position: Position) {
|
||||
fun setFixedPosition(destNum: Int, position: Position) {
|
||||
try {
|
||||
meshService?.requestPosition(myNodeNum ?: return, position)
|
||||
meshService?.setFixedPosition(destNum, position)
|
||||
} catch (ex: RemoteException) {
|
||||
errormsg("Request position error: ${ex.message}")
|
||||
errormsg("Set fixed position error: ${ex.message}")
|
||||
}
|
||||
}
|
||||
|
||||
fun removeFixedPosition() = setFixedPosition(Position(0.0, 0.0, 0))
|
||||
fun removeFixedPosition(destNum: Int) = setFixedPosition(destNum, Position(0.0, 0.0, 0))
|
||||
|
||||
// Set the radio config (also updates our saved copy in preferences)
|
||||
fun setConfig(config: ConfigProtos.Config) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue