buttplug icon indicating copy to clipboard operation
buttplug copied to clipboard

Do we really need to batch subcommands in generic commands?

Open qdot opened this issue 1 year ago • 0 comments

In messages like ScalarCmd (and the upcoming LevelCmd), RotateCmd, etc, we have the format of a main command that provides context, then subcommands held in the main command to update specific actuators. This was originally added for the ability to batch commands and update different actuators in the same message. However, I'm not sure anyone really uses this.

For developers on the client side, they don't know when a command needs to be batched for optimization sake (i.e. when multiple commands are packed into a single command at the line protocol level, possibly saving us extra bluetooth calls or whatever), and it's not really something I want to expose to them because that's a lot of extra work. Ideally we'll handle that for them via things like #673. However, if we do implement sending all updates out on the server side on intervals instead of immediately, it means we could also just do away with batching in messages altogether and make the protocol a very simple-to-implement one command = one actuator update format, or pack at the message level (since we technically take multiple buttplug messages in an array as part of a single packet, not that anyone ever does that) if someone really wants to optimize.

qdot avatar Nov 29 '24 08:11 qdot