Current MSP handling groups callbacks by their MSP command
and when a response comes back it calls all the pending handlers
with the same response object.
This works fine when all MSP calls are either pure input or pure
output (e.g. the have a non-empty payload in just one direction).
However, we've had some calls that have a payload in both directions
for some time, like MSPV2_SETTING. For those MSP commands, the
response will depend on the request, so calling all handlers on
the first response received produces the wrong results. It's also
problematic on handlers that expect any kind of response, since the
DataView object is reused, but its offset was never reset which
would result in the second handler getting an empty response.
Change this strategy to call just the first pending handlers for
the MSP command received in the response. While this is still
a theoretical race condition (there's no guarantee a sequence of
the same command with different payloads will be replied in the
same order as they were issued to the FC), it's the best we can
do unless we add some kind of nonce/token system to each MSP
request, which would incur a significant overhead.
helper.defaultsDialog.init() was called from both onConnect()
and onValidFirmware(). Thanks to @dzikuvx for pointing out that
just the last call was enough.
Check for DFU/serial port regularly during 10 seconds instead of
waiting 1s and trying once. Also, make sure that we don't mistake
DFU devices with serial ones, since the serial port might appear
briefly while the FC is rebooting.
* Offline missions (with FC disconnected) are now available for load and save to file.
Supports XML file format, should be compatible enough with other software
* removed default file name
* removed code in early stage of future developments
* code style and fc buttons
* map resize handling
* fix include nwdialog and fs packages
* xml2js lib with all dependencies in a single file