Example #1
0
        protected override bool UpdateConnectionIntervalNative(ConnectionInterval interval)
        {
            if (_gatt == null || _gattCallback == null)
            {
                Trace.Message("You can't update a connection interval for disconnected devices. Device is {0}", State);
                return(false);
            }

            if (Build.VERSION.SdkInt < BuildVersionCodes.Lollipop)
            {
                Trace.Message($"Update connection interval paramter in this Android API level");
                return(false);
            }

            try
            {
                // map to android gattConnectionPriorities
                // https://developer.android.com/reference/android/bluetooth/BluetoothGatt.html#CONNECTION_PRIORITY_BALANCED
                return(_gatt.RequestConnectionPriority((GattConnectionPriority)(int)interval));
            }
            catch (Exception ex)
            {
                throw new Exception($"Update Connection Interval fails with error. {ex.Message}");
            }
        }
Example #2
0
 public Boolean UpdateConnectionInterval(ConnectionInterval interval)
 {
     return(this.UpdateConnectionIntervalNative(interval));
 }
Example #3
0
 protected abstract Boolean UpdateConnectionIntervalNative(ConnectionInterval interval);
Example #4
0
 protected override bool UpdateConnectionIntervalNative(ConnectionInterval interval)
 {
     throw new NotImplementedException();
 }
 protected override bool UpdateConnectionIntervalNative(ConnectionInterval interval)
 {
     Trace.Message("Update Connection Interval not supported in UWP");
     throw new NotImplementedException();
 }
Example #6
0
 protected override bool UpdateConnectionIntervalNative(ConnectionInterval interval)
 {
     Trace.Message("Cannot update connection inteval on iOS.");
     return(false);
 }
Example #7
0
 public bool UpdateConnectionInterval(ConnectionInterval interval)
 {
     return(UpdateConnectionIntervalNative(interval));
 }
Example #8
0
 protected abstract bool UpdateConnectionIntervalNative(ConnectionInterval interval);
 private bool UpdateConnectionIntervalNative(ConnectionInterval interval) => throw new PlatformNotSupportedException();
Example #10
0
 public bool UpdateConnectionInterval(ConnectionInterval interval)
 {
     throw new NotImplementedException();
 }
 public bool UpdateConnectionInterval(ConnectionInterval interval) => UpdateConnectionIntervalNative(interval);
 private bool UpdateConnectionIntervalNative(ConnectionInterval interval)
 {
     Trace.Message("Update Connection Interval not supported in UWP");
     return(false);
 }
 public bool UpdateConnectionInterval(ConnectionInterval interval)
 {
     return(true);
 }