-
Notifications
You must be signed in to change notification settings - Fork 0
Devices & Scanning
The ButtplugManager class maintains a list of connected devices through its Devices array field. It provides functions to begin scanning for or stop scanning for devices, and lastly it exposes events for when devices are connected, disconnected, or when they change.
To allow devices to connect, you'll need to call the StartScanning function. After being called, compatible devices will automatically start to connect, triggering the OnDeviceAdded and OnDevicesChanged events.
To prevent additional devices from connecting, you can call StopScanning.
-
OnDevicesChanged()- called when a device connects or disconnects from the server, or otherwise changes -
OnDeviceAdded(FButtplugDevice Device)- called when a device connects to the server -
OnDeviceRemoved(int32 DeviceIndex)- called when a device disconnects from the server
If you would like to stop a device from vibration, moving, rotating, etc., you can use the StopDeviceCmd(int32 DeviceIndex) function to stop an individual device, or the StopAllDevices() function to stop all connected devices.
Connected devices are automatically stopped when disconnecting from the server, or if the device itself is disconnected.
You can request that the server provide an up to date list of devices using the RequestDeviceList function, but this should generally not be required, since the Devices array is automatically updated when devices connect or disconnect.