XCSoar / XCSoar

... the open-source glide computer
https://xcsoar.org
GNU General Public License v2.0
338 stars 278 forks source link

User defined sendNMEA1 string from .xpi events file does not fire #811

Closed iltis42 closed 2 years ago

iltis42 commented 2 years ago

XCSoar versions having and not having the problem:
Current version master branch 7.21, Linux build, and previous versions down to 7.04 tested.

Expected behavior: If i understand right the comment in: src/Input/InputEventsDevice.cpp, the following event is dedicated to sent a user defined string encapsulated into an NMEA message with $ and checksum to the connected device:

event=SendNMEAPort1 Test,1,2,3

e.g. i have connected at Device B, an XCVario with protocol XCVario (any other device should do, even cannot interpret the message), and i would like to see NMEA string containing $TEST,1,2,3*40 (checksum might be not correct in my example).

Actual behavior: iltis@hp:~/.xcsoar/logs$ grep "TEST" 2021-12-23_14-58.nmea iltis@hp:~/.xcsoar/logs$

NMEA string not created, not seen in log file (1) and, also in the Monitor of the device, nothing arrives. No issue to see XCS creating other commands like !g,b to modify ballast, e.g. in Flight menu, or MC Value. Hence sendNMEA1, behaves silent, nothing is sent.

(1) .nmea logfile apparently doesn't contain the TX direction of XCS, IMHO another thread to open if there is no reason why this should be missing.

Steps to reproduce the behavior Add the following lines into your .xpi file:

mode=Vario_menu type=key event=SendNMEAPort1 Test,1,2,3 event=StatusMessage Volume ++ label=VOLUME Up location=4

or enter .xpi as attached later in Look > Language, Input > Event, restart XCS, and press in the QuickMenu appering after first entering the Setup on the Screen "Vario", and there "Volume Up" button. You will see the popup Message "Volume ++" appearing, hence furthermore nothing happens. Device i have connected via Bluetooth, it is up and running, NMEA messages are coming in properly.

Do you have any idea what may have caused this? Absolutely not, source is unchanged since long at that place, maybe a side effect of something else that came in.

Do you have an idea how to solve the issue? Not yet.

iltis42 commented 2 years ago

Maybe i found it, the Device B is not sendNMEA1, but sendNMEA2, now i see the message! Its just not really documented, neither in User Guide, nor in source code...

iltis42 commented 2 years ago

sendNMEA2 works fine, can see now well my string generated, e.g. here by those entries in .xpi config file, so closed all fine, just needed a bit to figure out that "1" maps on Device A, and "2" on Device B. Maybe a small future improvement would be to match Port naming in there with real Device.

mode=Vario_menu type=key event=SendNMEAPort2 g,s1 event=StatusMessage Cruise label=STF location=2

XCV data log: I (00:04:06.006) DataMonitor.cpp: DM ch:1 dir:0 string:$g,s1*09