Prepare for alternative transmit-data #4351
wimalopaan
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(up to now, this is just a scratch pad for me)
Actually we transport the values of at most 16 channels from the handset to the model. There is no way to transport alternative data (arbitrary binary that may be used e.g. as "switches" for some function on the model side). But CRSF (and MAVLink) (and SumDV3, but not sure if MPM does transport those) gives the possibility to do so. Such functions would be of great interest to e.g. ship-, crawler and function-modelists). SPort has this possibility too (SPort commands).
The are attempts to transport this form of data over one / two of the "conventional" 16-channels, but these approaches are cumbersome due to the scaling of the channel values in various places, e.g. EdgeTx-mixer, module, receiver, flight-controller, ...
The primary source for such binary data would be IMHO some lua-widgets, that provide some virtual touch buttons or menus.
The PR #4102 would also allow to insert such binary data via SumDV3 (or CRSF) from other device like tablet/smartphone.
That PR uses defined, but useless logical switches (e.g. sticky switches with no inputs) as a store for binary switch data. This is kind of a hack and it would be much better, to have a data-structure that holds all the binary data (maybe a memory issue on small radios).
There should be a lua-api to read and manipulate that data. (Maybe there should also a mechanism to set that data via logical-or physical switches, but this would require an new UI-tab and is therefore a more heavyweight change).
And of course we need a way to transport the data. This can be done also via lua (crossfireTelemetryPush(), sportTelemetryPush()) (and of course in the future mavlinkTelemetryPush()).
For the beginning I would reccommend to define a datastructure that comprises of (64 * 2) = 128 bit which could resemble 64 quaternary switches. This includes the 64 binary switches of the SumDV3 protocol.
Required changes/additions:
-- luaSetSwitch()
-- luaGetSwitch()
-- luaSetAlternativData() (set the whole data-structure)
-- luaGetAlternativData() (get the whole data structure)
-- luaGetADataChunk() (stateful function: get the next data chunk to be transmitted)
-- add notify-function to the widget lua table. This function gets called if a switch changes value (this may result from a trainer input)
Future changes:
Beta Was this translation helpful? Give feedback.
All reactions