private USBAppIntentProfile MakeUSBProfile(AppIntentProfile appIntentProfile) { USBAppIntentProfile usbProfile = new USBAppIntentProfile(); if (appIntentProfile != null) { // Sensors usbProfile.sensorBitmask = 0; for (int i = 0; i < WearableConstants.SensorIds.Length; i++) { SensorId sensor = WearableConstants.SensorIds[i]; // Does this profile require this sensor? if (appIntentProfile.GetSensorInProfile(sensor)) { SensorFlags sensorBit = WearableTools.GetSensorFlag(sensor); usbProfile.sensorBitmask |= (int)sensorBit; } } // Gestures usbProfile.gestureBitmask = 0; for (int i = 0; i < WearableConstants.GestureIds.Length; i++) { GestureId gesture = WearableConstants.GestureIds[i]; // Does this profile require this gesture? if (appIntentProfile.GetGestureInProfile(gesture)) { GestureFlags gestureBit = WearableTools.GetGestureFlag(gesture); usbProfile.gestureBitmask |= (int)gestureBit; } } usbProfile.updateIntervalBitmask = 0; for (int i = 0; i < WearableConstants.UpdateIntervals.Length; i++) { SensorUpdateInterval interval = WearableConstants.UpdateIntervals[i]; // Does this profile require this update interval? if (appIntentProfile.GetIntervalInProfile(interval)) { int intervalBit = WearableTools.SensorUpdateIntervalToBit(interval); usbProfile.updateIntervalBitmask |= intervalBit; } } } return(usbProfile); }
internal WearableDebugProvider() { _virtualDevice = new Device { name = _name, firmwareVersion = _firmwareVersion, rssi = _rssi, availableSensors = _availableSensors, availableGestures = _availableGestures, productId = _productId, variantId = _variantId, uid = _uid, transmissionPeriod = 0, maximumPayloadPerTransmissionPeriod = 0, // NB: an extra sensor needs to be added to account for RotationSource maximumActiveSensors = WearableConstants.SensorIds.Length + 1 }; _name = WearableConstants.DebugProviderDefaultDeviceName; _firmwareVersion = WearableConstants.DefaultFirmwareVersion; _boseArEnabled = true; _firmwareUpdateAvailable = false; _acceptSecurePairing = true; _rssi = WearableConstants.DebugProviderDefaultRSSI; _availableSensors = WearableConstants.AllSensors; _availableGestures = WearableConstants.AllGestures; _productId = WearableConstants.DebugProviderDefaultProductId; _variantId = WearableConstants.DebugProviderDefaultVariantId; _uid = WearableConstants.DebugProviderDefaultUID; _simulatedDelayTime = WearableConstants.DebugProviderDefaultDelayTime; _searchingForDevice = false; _verbose = true; _eulerSpinRate = Vector3.zero; _axisAngleSpinRate = Vector3.up; _config = new WearableDeviceConfig(); _pendingGestures = new Queue <GestureData>(); _nextSensorUpdateTime = 0.0f; _rotation = Quaternion.identity; _dynamicDeviceInfo = WearableConstants.EmptyDynamicDeviceInfo; _updateInformation = new FirmwareUpdateInformation { icon = BoseUpdateIcon.Music, options = new[] { new FirmwareUpdateAlertOption { style = AlertStyle.Affirmative }, new FirmwareUpdateAlertOption { style = AlertStyle.Negative } } }; }