Add crsf-telemetry filtered queues #5773
Open
+281
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tries to implement #5757
It introduces the following new lua functions:
crossfireTelemetryCreatePrivateQueue()
crossfireTelemetryPopPrivate()
crossfireTelemetryRemovePrivateQueue()
and it changes (non-breaking) to interface of
create()
of lua widgets.
For lua widgets that use
crossfireTelemetryPop()
nothing changes.The
create(zone, options)
function gets a third parametercreate(zone, options, widget_id)
. Thewidget_id
is a unique widget-identifier, that will be used in the other three new lua functions.crossfireTelemetryCreatePrivateQueue(widget_id, filter_table)
inserts a new filter for the widget with the id
widget_id
.filter_table
can contain up to 8 bytes that are compared against the first 8 bytes (startung with thelength
byt eof the frame) of an incomingcrsf
packet.0
values serve as wild-cards. If acrsf
-packet matches it is sorted out into the according private queue.This function returns error codes:
-1
if an equivalent filter already exists,-2
if no more private filter queues are possible (up to 8 filter queues are possible)crossfireTelemetryPopPrivate(widget_id)
extract a
crsf
message out of the privatecrsf
message queue for widget withwidget_id
. Return values are the same as forcrossfireTelemetryPop()
.crossfireTelemetryRemovePrivateQueue(widget_id)
removes a private
crsf
message queue (this also happens automatically if the widget is terminated).