public ServicesPage(IBLEDevice device) { InitializeComponent(); BindingContext = vm = new ServicesViewModel(device) { Navigation = Navigation }; }
public async Task <IBLEDevice> ConnectAsync() { var newBle = await ble.ConnectAsync().ConfigureAwait(false); if (newBle != null) { ble = newBle; } return(newBle); }
public async Task <bool> ConnectAsync(string id, IBLEDevice device) { #if UNITY_EDITOR || UNITY_WEBGL var success = await webSocketProxy.ConnectAsync(id).ConfigureAwait(false); #else var success = await blePlugin.ConnectTo(id, this, this).ConfigureAwait(false); #endif if (success && !bleConnectionDict.ContainsKey(id)) { bleConnectionDict.Add(id, device); } return(success); }
public void Dispose() { UnlistenEvent(); ble?.Disconnect(); DeviceLostEvent = null; AccelUpdateEvent = null; GyroUpdateEvent = null; CompassUpdateEvent = null; QuaternionUpdateEvent = null; IMUSensorUpdateEvent = null; ButtonPushEvent = null; ButtonReleaseEvent = null; ble = null; }
public BLEService(BluetoothGattService nativeService, IBLEDevice device) { _nativeService = nativeService; _device = device; Characteristics = new List <IBLECharacteristic>(); Guid = GuidHelper.FromUUID(_nativeService.Uuid); IsPrimary = (_nativeService.Type == GattServiceType.Primary); foreach (var item in _nativeService.Characteristics) { var characteristic = new BLECharacteristic(item); Characteristics.Add(characteristic); } }
public Peripheral(IBLEDevice bleDevice) { ble = bleDevice; }
public ServicesViewModel(IBLEDevice device) { ServicesList = new ObservableCollection <IBLEService>(); App.Device = device; }
private async Task NavigateToServicesPage(IBLEDevice device) { await Navigation.PushAsync(new ServicesPage(device)); }