Move altosui to the top level, placing libaltos inside it. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: New AltosSerial.set_radio function sets channel/call Use this anytime you need to set the device radio channel and call sign, either for telemetry reception or packet mode origination. This uses the saved callsign and per-device radio channel number. Do not use this when opening a telemetrum as there won't be a saved channel number. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: Make AltosSerial.flush_input keep reading while non-empty Flushing the input buffer can take a while, especially over the packet link. Keep reading while stuff is appearing on the reply queue. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: switch channel selector to combo box. Shorten displayed device names A combo box displays the current value, which is quite nice to have. Add a 'toShortString' for AltosDevice so that the window frames and error messages don't have extra spaces generated by the altos_device toString method. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: Use timeouts to recover from broken packet links. This puts timeouts every place the system reads from the packet link and aborts the in-progress operation if it takes more than a second to get a response. Also mixed in here are persistent igniter status displays for the ejection testing UI. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: Open serial device at 'new' time. Prohibit duplicate opens. With the per-serial UI, there's never a reason to create a serial device without opening it right away. This eliminates the bug caused by not opening the serial device for telemetry reception. Serial devices can now be opened only once; this eliminates errors when trying to reflash or configure devices while receiving telemetry. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: Eliminate unncessary import altosui lines Java appears to automatically import every module from the current package. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: Fix channel setting at serial open time Was using the previous non-device-specific preferences API. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: Split out flight monitoring to separate window This creates a per-TD (or replay) window to contain the flight monitoring information, allowing multiple monitors. This also adds per-TD preferences for monitoring channel. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: Catch I/O errors on telemetry device, report to user This catches the USB device being unplugged and makes sure the user sees an error dialog in this case. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: Must flush serial line after configuring for telemetry Without flushing the configuration commands to the serial device, it never sees them as the telemetry input thread doesn't flush. Signed-off-by: Keith Packard <keithp@keithp.com>
Revert "altosui: Deal with altos bug setting radio channel while monitoring" This reverts commit ba65e4aeb952a1cf49a77f1e24e235508fcea71f. Testing the old code
altosui: Deal with altos bug setting radio channel while monitoring If the monitoring thread is active, then setting the radio channel can sometimes cause the monitoring thread to get stuck. I'm not entirely sure why though. For now, work around the issue by making sure monitoring is off, and the monitoring thread has stopped, before changing the radio channel. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: Report telemetry CRC errors in UI Telemetry CRC errors can signal problems with TeleMetrum or TeleDongle units, so report them in the UI. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: provide separate flush_input/flush_output for serial. deal with monitor automatically (yes, this should be two patches, but the diffs in AltosSerial were merged together). First, this replaces the existing flush/flush_reply mess with two simple functions, one to flush output to the serial device, making sure that all data written will be seen while we wait for input. The other sucks any pending input off of the serial line and discards it. Second, AltosSerial now tracks whether the serial line is being used for telemetry monitoring. If so, it enables monitoring, otherwise it disables it. Eliminates a bunch of manual state tracking elsewhere. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: Serial line is in UTF-8 encoding. Deal with it. We read bytes from the serial line and need to convert each line into a string. So, save the bytes and at EOL, pass the whole mess to the string constructor with the appropriate encoding info. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: flush replies from serial link when entering debug mode We use replies in debug mode a lot and depend on them matching the expected parameters. The case which caused trouble was using TeleMetrum to reprogram TeleDongle -- sending the 'm 0' command (to disable telemetry monitoring on TeleDongle) to the TeleMetrum caused it to reply 'Syntax Error' which confused the subsequent flashing operation. Flushing that reply gets things back in sync. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: flush serial output before waiting for reply
altosui: Add debug dongle API, split flash UI out Create an API to talk through the debug port on another AltOS device. Split the flash UI out from the flash implementation so that a command line flash utility can be written. Signed-off-by: Keith Packard <keithp@keithp.com>
altosui: Make teledongle callsign configurable Teledongle uses the callsign in packet mode; this provides a way to set that. Signed-off-by: Keith Packard <keithp@keithp.com>