public DeviceNotifyingHandler(BluetoothGatt gatt, GattClientObserver gattObserver) { _gatt = gatt; _gattObserver = gattObserver; gattObserver.CharacteristicValueChanged += OnCharacteristicValueChanged; gattObserver.DescriptorWritten += OnDescriptorWritten; }
private void OnDescriptorWritten(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, GattStatus status) { if (status == GattStatus.Success && _onSubscribed != null) { _onSubscribed(true); } }
public Device (BluetoothDevice nativeDevice, BluetoothGatt gatt, GattCallback gattCallback, int rssi) : base () { this._nativeDevice = nativeDevice; this._gatt = gatt; this._gattCallback = gattCallback; this._rssi = rssi; // when the services are discovered on the gatt callback, cache them here if (this._gattCallback != null) { this._gattCallback.ServicesDiscovered += (s, e) => { this._services = new List<IService> (); try{ var services = this._gatt.Services; foreach (var item in services) { this._services.Add (new Service (item, this._gatt, this._gattCallback)); } this.ServicesDiscovered (this, e); } catch { } }; } }
public void Update(BluetoothDevice nativeDevice, BluetoothGatt gatt, IGattCallback gattCallback) { _nativeDevice = nativeDevice; _gatt = gatt; _gattCallback = gattCallback; }
public Characteristic(BluetoothGattCharacteristic nativeCharacteristic, BluetoothGatt gatt, IGattCallback gattCallback) { _nativeCharacteristic = nativeCharacteristic; _gatt = gatt; _gattCallback = gattCallback; }
public override void OnReadRemoteRssi(ABluetooth.BluetoothGatt gatt, int rssi, ABluetooth.GattStatus status) { System.Diagnostics.Debug.WriteLine($"ReadRemoteRssi {rssi}"); _owner.ReadRemoteRssi?.Invoke(_owner, new RssiEventArgs { Status = status, Rssi = (short)rssi }); }
/// <Docs>GATT client</Docs> /// <summary> /// Raises the connection state change event. /// </summary> /// <param name="gatt">Gatt.</param> /// <param name="status">Status.</param> /// <param name="newState">New state.</param> public override void OnConnectionStateChange(BluetoothGatt gatt, GattStatus status, ProfileState newState) { base.OnConnectionStateChange(gatt, status, newState); if (status != GattStatus.Success) return; var device = new Device(gatt.Device, gatt, this, 0, null); switch (newState) { case ProfileState.Disconnected: device.State = DeviceState.Disconnected; try { gatt.Close(); gatt = null; } catch (Exception ex) { Debug.WriteLine("Unable to close connection to gatt. Exception: {0}", ex.Message); } finally { DeviceDisconnected(this, new DeviceConnectionEventArgs(device)); } break; case ProfileState.Connected: device.State = DeviceState.Connected; DeviceConnected(this, new DeviceConnectionEventArgs(device)); break; } }
public override void OnCharacteristicChanged(ABluetooth.BluetoothGatt gatt, ABluetooth.BluetoothGattCharacteristic characteristic) { System.Diagnostics.Debug.WriteLine($"CharacteristicChanged {characteristic.Uuid}"); _owner.CharacteristicChanged?.Invoke(_owner, new CharacteristicEventArgs { Characteristic = characteristic }); }
public override void OnCharacteristicWrite(ABluetooth.BluetoothGatt gatt, ABluetooth.BluetoothGattCharacteristic characteristic, ABluetooth.GattStatus status) { System.Diagnostics.Debug.WriteLine($"CharacteristicWrite {characteristic.Uuid} {status}"); _owner.CharacteristicWrite?.Invoke(_owner, new CharacteristicEventArgs { Characteristic = characteristic, Status = status }); }
public override void OnDescriptorRead (BluetoothGatt gatt, BluetoothGattDescriptor descriptor, GattStatus status) { base.OnDescriptorRead (gatt, descriptor, status); Console.WriteLine ("OnDescriptorRead: " + descriptor.ToString()); }
public override void OnDescriptorRead(ABluetooth.BluetoothGatt gatt, ABluetooth.BluetoothGattDescriptor descriptor, ABluetooth.GattStatus status) { System.Diagnostics.Debug.WriteLine($"DescriptorRead {descriptor.Uuid} {status}"); _owner.DescriptorRead?.Invoke(_owner, new DescriptorEventArgs { Descriptor = descriptor, Status = status }); }
private void GattObserverOnCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, GattStatus status) { if (_onRead != null) { _onRead(characteristic.GetValue(), status); } }
public Descriptor(BluetoothGattDescriptor nativeDescriptor, BluetoothGatt gatt, IGattCallback gattCallback) { _gattCallback = gattCallback; _gatt = gatt; _nativeDescriptor = nativeDescriptor; }
public Device (BluetoothDevice nativeDevice, BluetoothGatt gatt, GattCallback gattCallback, int rssi) : base () { this._nativeDevice = nativeDevice; this._gatt = gatt; this._gattCallback = gattCallback; this._rssi = rssi; // when the services are discovered on the gatt callback, cache them here if (this._gattCallback != null) { this._gattCallback.ServicesDiscovered += (s, e) => { var services = this._gatt.Services; this._services = new List<IService> (); foreach (var item in services) { this._services.Add (new Service (item, this._gatt, this._gattCallback)); foreach (var itm in item.Characteristics) { Console.WriteLine("Characteristic: " + itm.Uuid.ToString()); } } this.ServicesDiscovered (this, e); }; } }
public override void OnConnectionStateChange (BluetoothGatt gatt, GattStatus status, ProfileState newState) { Console.WriteLine ("OnConnectionStateChange: "); base.OnConnectionStateChange (gatt, status, newState); //TODO: need to pull the cached RSSI in here, or read it (requires the callback) Device device = new Device (gatt.Device, gatt, this, 0); switch (newState) { // disconnected case ProfileState.Disconnected: Console.WriteLine ("disconnected"); this.DeviceDisconnected (this, new DeviceConnectionEventArgs () { Device = device }); break; // connecting case ProfileState.Connecting: Console.WriteLine ("Connecting"); break; // connected case ProfileState.Connected: Console.WriteLine ("Connected"); this.DeviceConnected (this, new DeviceConnectionEventArgs () { Device = device }); break; // disconnecting case ProfileState.Disconnecting: Console.WriteLine ("Disconnecting"); break; } }
public override void OnServicesDiscovered(bt.BluetoothGatt gatt, [GeneratedEnum] bt.GattStatus status) { base.OnServicesDiscovered(gatt, status); ServicesDiscovered?.Invoke(this, new ServicesDiscoveredEventArgs(gatt, status)); _servicesDiscovered = true; }
internal Device (BluetoothDevice nativeDevice, BluetoothGatt gatt, GattCallback gattCallback, int rssi) : base () { this._nativeDevice = nativeDevice; _gatt = gatt; SetGattCallback(gattCallback); this._rssi = rssi; }
private void PlatformInit() { // android default - replaced by callback after request or change Mtu = 20; _gattCallback = new GattCallback(this); _gatt = ((ABluetooth.BluetoothDevice)Device).ConnectGatt(Android.App.Application.Context, AutoConnect, _gattCallback, ABluetooth.BluetoothTransports.Le); _gatt.RequestMtu(512); }
public Device(BluetoothDevice nativeDevice, BluetoothGatt gatt, IGattCallback gattCallback, int rssi, byte[] advertisementData = null) : base() { Update(nativeDevice, gatt, gattCallback); this._rssi = rssi; _advertisementData = advertisementData ?? new byte[0]; }
public override void OnServicesDiscovered(ABluetooth.BluetoothGatt gatt, ABluetooth.GattStatus status) { System.Diagnostics.Debug.WriteLine($"ServicesDiscovered {status}"); _owner._servicesDiscovered = true; _owner.ServicesDiscovered?.Invoke(_owner, new GattEventArgs { Status = status }); }
public override void OnServicesDiscovered (BluetoothGatt gatt, GattStatus status) { base.OnServicesDiscovered (gatt, status); Console.WriteLine ("OnServicesDiscovered: " + status.ToString ()); this.ServicesDiscovered (this, new ServicesDiscoveredEventArgs ()); }
public void Update(BluetoothDevice nativeDevice, BluetoothGatt gatt, IGattCallback gattCallback) { _nativeDevice = nativeDevice; _gatt = gatt; _gattCallback = gattCallback; Id = ParseDeviceId(); Name = _nativeDevice.Name; }
/// <summary> /// Raises the services discovered event. /// </summary> /// <param name="gatt">Gatt.</param> /// <param name="status">Status.</param> public override void OnServicesDiscovered(BluetoothGatt gatt, GattStatus status) { base.OnServicesDiscovered(gatt, status); if (status != GattStatus.Success) return; ServicesDiscovered(this, EventArgs.Empty); }
public override void OnDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, GattStatus status) { base.OnDescriptorWrite(gatt, descriptor, status); Console.WriteLine("GattCallBack: OnDescriptorWrite: " + descriptor.ToString()); this.DescriptorWrite(this, new CharacteristicReadEventArgs() { Characteristic = new Characteristic(descriptor.Characteristic, gatt, this) }); }
/// <summary> /// Initializes a new instance of the <see cref="BluetoothLE.Droid.Service"/> class. /// </summary> /// <param name="nativeService">Native service.</param> /// <param name="gatt">Native Gatt.</param> /// <param name="callback">Callback.</param> public Service(BluetoothGattService nativeService, BluetoothGatt gatt, GattCallback callback) { _nativeService = nativeService; _gatt = gatt; _callback = callback; _id = ServiceIdFromUuid(_nativeService.Uuid); Characteristics = new List<ICharacteristic>(); }
public override void OnConnectionStateChange(ABluetooth.BluetoothGatt gatt, ABluetooth.GattStatus status, ABluetooth.ProfileState newState) { System.Diagnostics.Debug.WriteLine($"ConnectionStateChanged {status}"); if (newState == ABluetooth.ProfileState.Connected) { _owner._connected = true; _owner._connectedHandle.Set(); gatt.DiscoverServices(); } }
public override void OnCharacteristicRead (BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, GattStatus status) { base.OnCharacteristicRead (gatt, characteristic, status); Console.WriteLine ("GattCallBack: OnCharacteristicRead: " + characteristic.GetStringValue (0)); this.CharacteristicValueUpdated (this, new CharacteristicReadEventArgs () { Characteristic = new Characteristic (characteristic, gatt, this) } ); }
public override void OnConnectionStateChange(bt.BluetoothGatt gatt, [GeneratedEnum] bt.GattStatus status, [GeneratedEnum] bt.ProfileState newState) { base.OnConnectionStateChange(gatt, status, newState); ConnectionStateChange?.Invoke(this, new ConnectionStateChangeEventArgs(gatt, status, newState)); if (!_servicesDiscovered) { gatt.DiscoverServices(); } }
public override void OnCharacteristicChanged (BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { base.OnCharacteristicChanged (gatt, characteristic); Console.WriteLine ("OnCharacteristicChanged: " + characteristic.GetStringValue (0)); var f = new CharacteristicReadEventArgs () { Characteristic = new Characteristic (characteristic, gatt, this)}; Debug.WriteLine ("OnCharacteristicChanged" + f); this.CharacteristicValueUpdated (this, f); }
/// <summary> /// Initializes a new instance of the <see cref="BluetoothLE.Droid.Characteristic"/> class. /// </summary> /// <param name="characteristic">Characteristic.</param> /// <param name="gatt">Gatt.</param> /// <param name="gattCallback">Gatt callback.</param> public Characteristic(BluetoothGattCharacteristic characteristic, BluetoothGatt gatt, GattCallback gattCallback) { _nativeCharacteristic = characteristic; _gatt = gatt; _callback = gattCallback; if (_callback != null) { _callback.CharacteristicValueUpdated += CharacteristicValueUpdated; } }
public void Connect(bool autoConnect = false) { var device = Android.Bluetooth.BluetoothAdapter.DefaultAdapter?.GetRemoteDevice(_address); if (device == null) { throw new Exception($"Can not get remote device with address:\"{_address}\"."); } var callback = new AndroidBluetoothGattCallback(); _gatt = device.ConnectGatt(Android.App.Application.Context, autoConnect, callback); }
private void NotifyOnValueChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { var hexText = FindViewById<TextView>(Resource.Id.ReceivedNotificationHex); var stringText = FindViewById<TextView>(Resource.Id.ReceivedNotificationString); var receivedBytes = characteristic.GetValue(); RunOnUiThread(() => { hexText.SetText(BitConverter.ToString(receivedBytes), TextView.BufferType.Normal); stringText.SetText(Encoding.ASCII.GetString(receivedBytes), TextView.BufferType.Normal); }); }
// �ڑ����ω��������ɔ����郁�\�b�h public override void OnConnectionStateChange(BluetoothGatt gatt, [GeneratedEnum] GattStatus status, [GeneratedEnum] ProfileState newState) { base.OnConnectionStateChange(gatt, status, newState); if (newState == ProfileState.Connected) { // �ڑ���ԂɂȂ�����T�[�r�X��������� // �T�[�r�X������������OnServicesDiscovered������ gatt.DiscoverServices(); } else if(newState == ProfileState.Disconnected) { //�|�b�v�A�b�v�Ȃǂ�o���āA�C�ӂ�Activity�Ɉړ�����Ȃǂ��Ă������� } }
public void Dispose() { try { if (_gatt != null) { _gatt.Close(); _gatt = null; } } catch (Exception exception) { Xamarin.Forms.Internals.Log.Warning("Dispose::Exception", exception.Message); } }
public void Dispose() { try { if (_gatt != null) { _gatt.Close(); _gatt = null; } } catch (Exception exception) { Log.Warning("Dispose::Exception", exception.Message); } }
public void Connect(bool autoConnect = false) { var device = AndroidBluetooth.BluetoothAdapter.DefaultAdapter?.GetRemoteDevice(_address); if (device == null) { throw new Exception($"Can not get remote device with address:\"{_address}\"."); } var callback = new AndroidBluetoothGattCallback(); callback.OnConnectionStateChangeOccured += Callback_OnConnectionStateChangeOccured; callback.OnServicesAlreadyDiscovered += Callback_OnServicesAlreadyDiscovered; callback.OnCharacteristicAlreadyChanged += Callback_OnCharacteristicAlreadyChanged; _gatt = device.ConnectGatt(Android.App.Application.Context, autoConnect, callback); }
/// <summary> /// Initializes a new instance of the <see cref="BluetoothLE.Droid.Device"/> class. /// </summary> /// <param name="nativeDevice">Native device.</param> /// <param name="gatt">Native Gatt.</param> /// <param name="callback">Callback.</param> /// <param name="rssi">Rssi.</param> /// <param name="scanRecord">scanRecord.</param> public Device(BluetoothDevice nativeDevice, BluetoothGatt gatt, GattCallback callback, int rssi, byte[] scanRecord) { _nativeDevice = nativeDevice; _gatt = gatt; _callback = callback; _scanRecord = scanRecord; _rssi = rssi; _id = DeviceIdFromAddress(_nativeDevice.Address); if (_callback != null) { _callback.ServicesDiscovered += ServicesDiscovered; } Services = new List<IService>(); }
private void GattCallback_ServicesDiscoveredEvent(BluetoothGatt gatt) { foreach (var item in gatt.Services) { gattServices.Add(item.Uuid.ToString()); System.Diagnostics.Debug.WriteLine($"�yService�zUUID:{item.Uuid}"); } var arry = gattServices.ToArray(); // Main Thread�ŏ���������B RunOnUiThread(() => { listView.Adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, arry); }); }
public override void OnConnectionStateChange(ABluetooth.BluetoothGatt gatt, ABluetooth.GattStatus status, ABluetooth.ProfileState newState) { System.Diagnostics.Debug.WriteLine($"ConnectionStateChanged {status} {newState}"); _owner.ConnectionStateChanged?.Invoke(_owner, new ConnectionStateEventArgs { Status = status, State = newState }); if (newState == ABluetooth.ProfileState.Connected) { if (!_owner._servicesDiscovered) { gatt.DiscoverServices(); } } else { _owner.Device.OnGattServerDisconnected(); } }
public override void OnCharacteristicRead(bt.BluetoothGatt gatt, bt.BluetoothGattCharacteristic characteristic, [GeneratedEnum] bt.GattStatus status) { base.OnCharacteristicRead(gatt, characteristic, status); this.CharacteristicRead?.Invoke(this, new CharacteristicValueChangedEventArgs(gatt, characteristic, status)); byte[] value = characteristic.GetValue(); var myChar = this.ServicesById[characteristic.Service.Uuid].CharacteristicsById[characteristic.Uuid]; // If the system architecture is little-endian (that is, little end first), // reverse the byte array. if (BitConverter.IsLittleEndian) { Array.Reverse(value); } myChar.GetValueCompletionSource?.SetResult(value); myChar.GetValueCompletionSource = null; }
public Characteristic (BluetoothGattCharacteristic nativeCharacteristic, BluetoothGatt gatt, GattCallback gattCallback) { this._nativeCharacteristic = nativeCharacteristic; this._gatt = gatt; this._gattCallback = gattCallback; if (this._gattCallback != null) { // wire up the characteristic value updating on the gattcallback this._gattCallback.CharacteristicValueUpdated += (object sender, CharacteristicReadEventArgs e) => { // it may be other characteristics, so we need to test if(e.Characteristic.ID == this.ID) { // update our underlying characteristic (this one will have a value) //TODO: is this necessary? probably the underlying reference is the same. //this._nativeCharacteristic = e.Characteristic; this.ValueUpdated (this, e); } }; } }
private void GattCallback_CharacteristicReadEvent(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, GattStatus status) { System.Diagnostics.Debug.WriteLine($"�yGattCallback_CharacteristicReadEvent�z:{gatt},{characteristic},{status}"); // �K�v�ɉ����ăX�e�[�^�X�ɂ�菈���� switch (status) { case GattStatus.ConnectionCongested: break; case GattStatus.Failure: break; case GattStatus.InsufficientAuthentication: break; case GattStatus.InsufficientEncryption: break; case GattStatus.InvalidAttributeLength: break; case GattStatus.InvalidOffset: break; case GattStatus.ReadNotPermitted: break; case GattStatus.RequestNotSupported: break; case GattStatus.Success: System.Diagnostics.Debug.WriteLine($"�ySuccess�z:{gatt},{characteristic},{status}"); var descs = characteristic.Descriptors; foreach (var item in descs) { System.Diagnostics.Debug.WriteLine($"{item.Uuid},{item.Permissions}"); } break; case GattStatus.WriteNotPermitted: break; default: break; } }
public override void OnConnectionStateChange (BluetoothGatt gatt, GattStatus status, ProfileState newState) { Console.WriteLine ("OnConnectionStateChange: "); //TODO: need to pull the cached RSSI in here, or read it (requires the callback) var device = _adapter.DiscoveredDevices.Find(gatt.Device); if (device == null) { Debug.WriteLine(string.Format("Device {0} has not been discovered yet.", gatt.Device.Name)); device = new Device(gatt.Device, gatt, this, 0); _adapter.DiscoveredDevices.Add(device); } switch (newState) { // disconnected case ProfileState.Disconnected: Console.WriteLine("Disconnected."); device.Disconnect(); OnDeviceDisconnected(device); break; // connecting case ProfileState.Connecting: Console.WriteLine("Connecting"); device.SetState(DeviceState.Connecting); break; // connected case ProfileState.Connected: Console.WriteLine("Connected"); device.SetState(DeviceState.Connected); OnDeviceConnected(device); break; // disconnecting case ProfileState.Disconnecting: Console.WriteLine("Disconnecting"); device.SetState(DeviceState.Disconnected); break; } }
public override void OnConnectionStateChange (BluetoothGatt gatt, GattStatus status, ProfileState newState) { Console.WriteLine ("OnConnectionStateChange: "); base.OnConnectionStateChange (gatt, status, newState); //TODO: need to pull the cached RSSI in here, or read it (requires the callback) Device device = new Device (gatt.Device, gatt, this, 0); switch (newState) { // disconnected case ProfileState.Disconnected: Console.WriteLine ("disconnected"); if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { Console.WriteLine("Changing connection priority to balanced"); gatt.RequestConnectionPriority(BluetoothGatt.ConnectionPriorityBalanced); } this.DeviceDisconnected (this, new DeviceConnectionEventArgs () { Device = device }); break; // connecting case ProfileState.Connecting: Console.WriteLine ("Connecting"); break; // connected case ProfileState.Connected: Console.WriteLine ("Connected"); if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { Console.WriteLine("Changing connection priority to high"); gatt.RequestConnectionPriority(BluetoothGatt.ConnectionPriorityHigh); } this.DeviceConnected (this, new DeviceConnectionEventArgs () { Device = device }); break; // disconnecting case ProfileState.Disconnecting: Console.WriteLine ("Disconnecting"); break; } }
private void GattCallback_ServicesDiscoveredEvent(BluetoothGatt gatt) { // �����UUID�ɐڑ����ăL�����N�^���X�e�B�b�N��擾 var service = gatt.GetService(Java.Util.UUID.FromString(serviceUuid)); var characteristics = service.Characteristics; foreach (var item in characteristics) { gattCharacteristics.Add(new TableItem { Text1 = "CharacteristicName", Text2 = item.Uuid.ToString(), Text3 = item.Properties.ToString(), Text4 = item.WriteType.ToString() }); //gattCharacteristics.Add(item.Uuid.ToString()); } //var arry = gattCharacteristics.ToArray(); // Main Thread�ŏ���������B RunOnUiThread(() => { //listView.Adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, arry); listView.Adapter = new CharacteristicsListAdapter(this, gattCharacteristics); }); }
public override void OnCharacteristicWrite(bt.BluetoothGatt gatt, bt.BluetoothGattCharacteristic characteristic, [GeneratedEnum] bt.GattStatus status) { base.OnCharacteristicWrite(gatt, characteristic, status); this.CharacteristicWrite?.Invoke(this, new CharacteristicValueChangedEventArgs(gatt, characteristic, status)); }
public override void OnDescriptorRead(ABluetooth.BluetoothGatt gatt, ABluetooth.BluetoothGattDescriptor descriptor, ABluetooth.GattStatus status) { System.Diagnostics.Debug.WriteLine($"DescriptorRead {descriptor.Uuid} {status}"); _owner._descriptorReadHandle.Set(); }
public override void OnCharacteristicChanged(ABluetooth.BluetoothGatt gatt, ABluetooth.BluetoothGattCharacteristic characteristic) { System.Diagnostics.Debug.WriteLine($"CharacteristicChanged {characteristic.Uuid}"); _owner.CharacteristicChanged?.Invoke(this, characteristic.Uuid); }
public override void OnCharacteristicWrite(ABluetooth.BluetoothGatt gatt, ABluetooth.BluetoothGattCharacteristic characteristic, ABluetooth.GattStatus status) { System.Diagnostics.Debug.WriteLine($"CharacteristicWrite {characteristic.Uuid} {status}"); _owner._characteristicWriteHandle.Set(); }
private void PlatformInit() { _gattCallback = new GattCallback(this); _gatt = ((ABluetooth.BluetoothDevice)Device).ConnectGatt(Android.App.Application.Context, true, _gattCallback, ABluetooth.BluetoothTransports.Le); }
public override void OnMtuChanged(ABluetooth.BluetoothGatt gatt, int mtu, ABluetooth.GattStatus status) { System.Diagnostics.Debug.WriteLine($"OnMtuChanged Status:{status} Size:{mtu}"); _owner.Mtu = mtu; base.OnMtuChanged(gatt, mtu, status); }
public ConnectionStateChangeEventArgs(bt.BluetoothGatt gatt, bt.GattStatus status, bt.ProfileState newState) { Gatt = gatt; Status = status; NewState = newState; }
public override void OnPhyUpdate(ABluetooth.BluetoothGatt gatt, ABluetooth.LE.ScanSettingsPhy txPhy, ABluetooth.LE.ScanSettingsPhy rxPhy, ABluetooth.GattStatus status) { System.Diagnostics.Debug.WriteLine($"PhyUpdate TX:{txPhy} RX:{rxPhy} Status:{status}"); }
public CharacteristicChangedEventArgs(bt.BluetoothGatt gatt, bt.BluetoothGattCharacteristic characteristic) { this.Gatt = gatt; this.Characteristic = characteristic; }
public ServicesDiscoveredEventArgs(bt.BluetoothGatt gatt, bt.GattStatus status) { Gatt = gatt; Status = status; }
public override void OnCharacteristicChanged(bt.BluetoothGatt gatt, bt.BluetoothGattCharacteristic characteristic) { base.OnCharacteristicChanged(gatt, characteristic); CharacteristicChanged?.Invoke(this, new CharacteristicChangedEventArgs(gatt, characteristic)); }
public override void OnServicesDiscovered(ABluetooth.BluetoothGatt gatt, ABluetooth.GattStatus status) { System.Diagnostics.Debug.WriteLine($"ServicesDiscovered {status}"); _owner._servicesDiscoveredHandle.Set(); }
internal BluetoothRemoteGATTServer(BluetoothDevice device, ABluetooth.BluetoothDevice bluetoothDevice) : this(device) { _gattCallback = new GattCallback(this); NativeGatt = bluetoothDevice.ConnectGatt(Android.App.Application.Context, false, _gattCallback); }
private void PlatformInit() { _gattCallback = new GattCallback(this); _gatt = ((ABluetooth.BluetoothDevice)Device).ConnectGatt(Android.App.Application.Context, false, _gattCallback); }
public CharacteristicValueChangedEventArgs(bt.BluetoothGatt gatt, bt.BluetoothGattCharacteristic characteristic, bt.GattStatus status) { this.Gatt = gatt; this.Characteristic = characteristic; this.Status = status; }