Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions buttplug/src/client/client_event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ where
let device = self.create_client_device(d);
self.send_client_event(ButtplugClientEvent::DeviceAdded(device));
}
self.send_client_event(ButtplugClientEvent::DeviceListReceived);
true
}
}
Expand Down
3 changes: 3 additions & 0 deletions buttplug/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ pub enum ButtplugClientEvent {
/// Emitted when a device has been removed from the server. Includes a
/// [ButtplugClientDevice] object representing the device.
DeviceRemoved(Arc<ButtplugClientDevice>),
/// Emitted when the device list is received as a response to a
/// DeviceListRequest call, which is sent during the handshake.
DeviceListReceived,
/// Emitted when a client has not pinged the server in a sufficient amount of
/// time.
PingTimeout,
Expand Down
4 changes: 4 additions & 0 deletions buttplug/tests/test_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ async fn test_client_scanning_finished() {
let (client, _) = test_client_with_device().await;
let mut recv = client.event_stream();
assert!(client.start_scanning().await.is_ok());
assert!(matches!(
recv.next().await.expect("Test, assuming infallible."),
ButtplugClientEvent::DeviceListReceived
));
assert!(matches!(
recv.next().await.expect("Test, assuming infallible."),
ButtplugClientEvent::ScanningFinished
Expand Down