example 'meshtastic': send phone GPS position to radio; revisions

This commit is contained in:
pls.153 2023-07-15 10:48:34 +02:00
parent 80acb3c92d
commit 9699a0ce6f
28 changed files with 1566 additions and 79 deletions

View file

@ -1,5 +1,16 @@
(in-package :radios)
(defvar *found* nil)
(defun device-discovered (name)
"Show discovered (cached) device, which may not be reachable / turned on."
(unless *found*
(add-radio
(list :name name
:hw-model "Meshtastic" ; we don't know yet
:current (equal name (app:setting :device))
:ini t))))
(defun add-radio (radio)
"Adds passed RADIO (a PLIST) to QML item model.
The model keys are:
@ -10,10 +21,17 @@
(setf lora:*schedule-clear* nil)
(q! |clear| ui:*radios*))
(defun change-radio (name) ; called from QML
(defun change-radio (name) ; see QML
(app:change-setting :device name)
(unless *found*
(clear))
(qlater (lambda () (lora:start-device-discovery name)))
(values))
(defun reset-default-radio ()
;; TODO: add in UI settings
(app:change-setting :device nil))
(defun reset-configured ()
;; TODO: add in UI settings
(app:change-setting :configured nil))