-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: command batching SOFIE-2549 #157
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #157 +/- ##
==========================================
+ Coverage 86.29% 86.38% +0.09%
==========================================
Files 180 181 +1
Lines 5814 5853 +39
Branches 958 965 +7
==========================================
+ Hits 5017 5056 +39
Misses 775 775
Partials 22 22 ☔ View full report in Codecov by Sentry. |
34a2972
to
fc1256e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me from an initial read through
feature
When sending commands to the atem, it is only possible to send one per packet.
The
sendCommands
method is now exposed, allowing for sending multiple commands in one packet.Each call to the method will result in packets being sent, no buffering/debouncing is performed between calls. Commands are packed into packets in order, up to a defined byte limit per packet.
The maximum packet size is defined based on the
packetMtu
property supplied to the constructor. Care should be taken when setting this, as any upload transfers do not fully respect this value and will result in packets failing to send.This partially covers #140, but only solves the case of constructing the commands manually (or with
atem-state
), not usage through the methods provided on theAtem
class.A friendlier batching api can be built on top of this work by someone later.
I have tested this against a Constellation 2ME HD by sending a pair of
MixEffectKeyDVECommand
commands multiple time at once, enough so that it spans multiple packets. The packets were acked, indicating that they were transmitted and received successfully.