Exemple #1
0
 private void OnPairSelected()
 {
     if (!(device.IsPaired))
     {
         BhapticsAndroidManager.Pair(device.Address);
     }
 }
        public void OnPairDevice()
        {
            var devices = BhapticsAndroidManager.GetDevices();
            int rssi    = -9999;
            int index   = -1;

            for (int i = 0; i < devices.Count; i++)
            {
                if (AndroidUtils.CanPair(devices[i], DeviceType))
                {
                    if (rssi < devices[i].Rssi)
                    {
                        rssi  = devices[i].Rssi;
                        index = i;
                    }
                }
            }

            if (index != -1)
            {
                if (DeviceType == PositionType.Vest)
                {
                    BhapticsAndroidManager.Pair(devices[index].Address);
                }
                else
                {
                    BhapticsAndroidManager.Pair(devices[index].Address, DeviceType.ToString());
                }
            }
        }
 private void OnPairSelected()
 {
     if (AndroidUtils.ConvertConnectionStatus(device.ConnectionStatus) == 2)
     {
         BhapticsAndroidManager.Pair(device.Address);
     }
 }