public override void OnServicesDiscovered(bt.BluetoothGatt gatt, [GeneratedEnum] bt.GattStatus status) { base.OnServicesDiscovered(gatt, status); ServicesDiscovered?.Invoke(this, new ServicesDiscoveredEventArgs(gatt, status)); _servicesDiscovered = true; }
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 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 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 }); }
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 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 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 override void OnCharacteristicWrite(ABluetooth.BluetoothGatt gatt, ABluetooth.BluetoothGattCharacteristic characteristic, ABluetooth.GattStatus status) { System.Diagnostics.Debug.WriteLine($"CharacteristicWrite {characteristic.Uuid} {status}"); _owner._characteristicWriteHandle.Set(); }
private Abstractions.GattStatus Map(AndroidBluetooth.GattStatus status) { return((Abstractions.GattStatus)(int) status); }
public override void OnNotificationSent(BluetoothDevice peripheral, AGattStatus status) => this.NotificationSent.OnNext(new GattEventArgs(peripheral));
public ServicesDiscoveredEventArgs(bt.BluetoothGatt gatt, bt.GattStatus status) { Gatt = gatt; Status = status; }
public CharacteristicValueChangedEventArgs(bt.BluetoothGatt gatt, bt.BluetoothGattCharacteristic characteristic, bt.GattStatus status) { this.Gatt = gatt; this.Characteristic = characteristic; this.Status = status; }
public ConnectionStateChangeEventArgs(bt.BluetoothGatt gatt, bt.GattStatus status, bt.ProfileState newState) { Gatt = gatt; Status = status; NewState = newState; }
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 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 OnServicesDiscovered(ABluetooth.BluetoothGatt gatt, ABluetooth.GattStatus status) { System.Diagnostics.Debug.WriteLine($"ServicesDiscovered {status}"); _owner._servicesDiscoveredHandle.Set(); }
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 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 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 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 }); }