···131131/// things alive. Currently this only applies to iOS backgrounding with bluetooth devices, but since
132132/// we never know which of our hundreds of supported devices someone might connect, we need context
133133/// as to which keepalive strategy to use.
134134+///
135135+/// When choosing a keepalive strategy for a protocol:
136136+///
137137+/// - All protocols use NoStrategy by default. For many devices, sending trash will break them in
138138+/// very weird ways and we can't risk that, so we need to know the protocol context.
139139+/// - If the protocol already needs its own keepalive (Satisfyer, Mysteryvibe, etc...), use
140140+/// NoStrategy for now. RepeatLastPacketStrategy could be used, but we'd need per-protocol
141141+/// timeouts at that point.
142142+/// - If the protocol has a command that essentially does nothing to the actuators, set up
143143+/// RepeatPacketStrategy to use that. This is useful for devices that have info commands (like
144144+/// Lovense), ping commands (like The Handy), sensor commands that aren't yet subscribed to output
145145+/// notifications, etc...
146146+/// - For many devices with only scalar actuators, RepeatLastPacketStrategy should work. You just
147147+/// need to make sure the protocol doesn't have a packet counter or something else that will trip
148148+/// if the same packet is replayed multiple times.
149149+/// - For all other devices, use Custom Strategy. This assumes the protocol will have implemented a
150150+/// method to generate a valid packet.
134151#[derive(Debug)]
135152pub enum ProtocolKeepaliveStrategy {
136153 /// Do nothing. This is for protocols that already require internal keepalives, like satisfyer,
···141158 /// Repeat whatever the last packet sent was, and send Stop commands until first packet sent. This
142159 /// will be useful for most devices that purely use scalar commands.
143160 RepeatLastPacketStrategy,
144144- /// Request battery values as the keep alive.
145145- BatteryStrategy,
146146- /// Protocol implements a custom strategy, use that.
147147- CustomStrategy,
161161+ /// Call a specific method on the protocol implementation to generate keepalive packets.
162162+ CustomStrategy
148163}
149164150165pub trait ProtocolIdentifierFactory: Send + Sync {