コード例 #1
0
        /// <summary>
        /// Helper function to convert our AppIntentProfile to something more easily consumable
        /// by the bridge layer.
        /// </summary>
        private static BridgeAppIntentProfile CreateBridgeAppIntentProfile(AppIntentProfile appIntentProfile)
        {
            BridgeAppIntentProfile bridgeAppIntentProfile = new BridgeAppIntentProfile();
            int sensors       = 0;
            int samplePeriods = 0;
            int gestures      = 0;

            if (appIntentProfile != null)
            {
                for (int i = 0; i < WearableConstants.SENSOR_IDS.Length; i++)
                {
                    if (appIntentProfile.GetSensorInProfile(WearableConstants.SENSOR_IDS[i]))
                    {
                        sensors |= (1 << i);
                    }
                }

                for (int i = 0; i < WearableConstants.UPDATE_INTERVALS.Length; i++)
                {
                    if (appIntentProfile.GetIntervalInProfile(WearableConstants.UPDATE_INTERVALS[i]))
                    {
                        samplePeriods |= (1 << i);
                    }
                }

                for (int i = 0; i < WearableConstants.GESTURE_IDS.Length; i++)
                {
                    if (WearableConstants.GESTURE_IDS[i] == GestureId.None)
                    {
                        continue;
                    }

                    if (appIntentProfile.GetGestureInProfile(WearableConstants.GESTURE_IDS[i]))
                    {
                        gestures |= (1 << (i - 1));
                    }
                }
            }

            bridgeAppIntentProfile.sensors       = sensors;
            bridgeAppIntentProfile.samplePeriods = samplePeriods;
            bridgeAppIntentProfile.gestures      = gestures;

            return(bridgeAppIntentProfile);
        }
コード例 #2
0
 private static extern bool WearableValidateAppIntents(BridgeAppIntentProfile bridgeAppIntentProfile);
コード例 #3
0
 private static extern void WearableStartDeviceSearch(BridgeAppIntentProfile bridgeAppIntentProfile, int rssiThreshold);
コード例 #4
0
        public bool IsAppIntentProfileValid(AppIntentProfile appIntentProfile)
        {
            BridgeAppIntentProfile bridgeAppIntentProfile = CreateBridgeAppIntentProfile(appIntentProfile);

            return(WearableValidateAppIntents(bridgeAppIntentProfile));
        }
コード例 #5
0
        public void StartSearch(AppIntentProfile appIntentProfile, int rssiThreshold)
        {
            BridgeAppIntentProfile bridgeAppIntentProfile = CreateBridgeAppIntentProfile(appIntentProfile);

            WearableStartDeviceSearch(bridgeAppIntentProfile, rssiThreshold);
        }
コード例 #6
0
 private static extern void WearableConnectToLastDevice(BridgeAppIntentProfile bridgeAppIntentProfile);
コード例 #7
0
        public void ReconnectToLastSuccessfulDeviceInternal(AppIntentProfile appIntentProfile)
        {
            BridgeAppIntentProfile bridgeAppIntentProfile = CreateBridgeAppIntentProfile(appIntentProfile);

            WearableConnectToLastDevice(bridgeAppIntentProfile);
        }