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 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(); } }
// �ڑ����ω��������ɔ����郁�\�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 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 void DiscoverServices() { _gatt.DiscoverServices(); }