Zum Hauptinhalt springen
Diese Seite wurde automatisch übersetzt und kann Fehler enthalten. Original auf Englisch ansehen

Class BhapticsAppleDevices

BhapticsAppleDevices provides the API for scanning and connecting to bHaptics devices directly over CoreBluetooth on iOS and visionOS. See the iOS/visionOS Connection Guide for the overall setup and the sample UI.

hinweis

Use these APIs for iOS/visionOS physical devices only.

APIBehavior
BhapticsAppleDevices.Scan()Starts a BLE scan for nearby bHaptics devices
BhapticsAppleDevices.StopScan()Stops the scan
BhapticsAppleDevices.IsScanning()Whether a scan is in progress
BhapticsAppleDevices.GetDevices()List of devices — HapticDevice (name, Position, IsConnected, IsPaired)
BhapticsAppleDevices.Pair(id)Pair (remember) + connect
BhapticsAppleDevices.Unpair(id)Unpair + disconnect
BhapticsAppleDevices.IsSupportedWhether this is an iOS/visionOS physical device (false in the Editor or on other platforms)
// Minimal example: start scanning → poll the list → connect to the first device
BhapticsAppleDevices.Scan();

var devices = BhapticsAppleDevices.GetDevices(); // Call periodically to refresh
if (devices.Count > 0 && !devices[0].IsPaired)
{
BhapticsAppleDevices.Pair(devices[0].Address);
}