From 58a0068905ab44e0e56d3fd7212fed8defb5523b Mon Sep 17 00:00:00 2001 From: "pls.153" Date: Thu, 1 Feb 2024 20:13:44 +0100 Subject: [PATCH] example 'meshtastic': fix bug in echo test messages (see ':e') --- examples/meshtastic/lisp/lora.lisp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/meshtastic/lisp/lora.lisp b/examples/meshtastic/lisp/lora.lisp index 2f2c6e5..770c1bd 100644 --- a/examples/meshtastic/lisp/lora.lisp +++ b/examples/meshtastic/lisp/lora.lisp @@ -194,7 +194,7 @@ :alt (me:altitude pos) :time (me:time pos)))))) -(let (echo-text) +(let (echo-text echo-receiver) (defun process-received () "Walks *RECEIVED* FROM-RADIOs and saves relevant data." (setf *received* (nreverse *received*)) @@ -215,8 +215,11 @@ (setf msg:*message-id* (max mid msg:*message-id*)) (if (x:starts-with ":e" text) ; 'echo' (progn - (setf echo-text (subseq text #.(length ":e"))) - (qsingle-shot 1000 (lambda () (send-message (x:cc ":e" echo-text))))) + (setf echo-text (subseq text #.(length ":e")) + echo-receiver (me:from packet)) + (qsingle-shot 1000 (lambda () + (let ((*receiver* echo-receiver)) + (send-message (x:cc ":e" echo-text)))))) (progn (when (x:starts-with ":e" text) (setf text (msg:echo-message text (me:from packet) (me:rx-snr packet) (me:rx-rssi packet))))