private void GattServerCharacteristic_OnWrite(object sender, ICharacteristicWriteRequest e) { ulong address; try { address = BitConverter.ToUInt64(e.Value, 0); } catch (Exception) { e.RespondWithProtocolError(GattErrorCode.Failure); return; } if (!RfcommAddressDict.ContainsKey(e.SourceDevice)) { RfcommAddressDict.Add(e.SourceDevice, address); } else { RfcommAddressDict[e.SourceDevice] = address; } e.RespondSuccess(); ClientRfcommServiceWrapper.OnRfcommAddressWrite?.Invoke(ClientRfcommServiceWrapper, new KeyValuePair <IBluetoothDevice, ulong>(e.SourceDevice, address)); }
private void OnManufacturerNameStringCharacteristicWrite(object sender, ICharacteristicWriteRequest e) { e.RespondSuccess(); }
private async void GattServerCharacteristic_OnWrite(object sender, ICharacteristicWriteRequest e) { await SendAsync(e.Value); e.RespondSuccess(); }