BluetoothGatt.WriteCharacteristic Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
WriteCharacteristic(BluetoothGattCharacteristic) |
Writes a given characteristic and its values to the associated remote device. |
WriteCharacteristic(BluetoothGattCharacteristic, Byte[], Int32) |
Writes a given characteristic and its values to the associated remote device. |
WriteCharacteristic(BluetoothGattCharacteristic)
Writes a given characteristic and its values to the associated remote device.
[Android.Runtime.Register("writeCharacteristic", "(Landroid/bluetooth/BluetoothGattCharacteristic;)Z", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public bool WriteCharacteristic (Android.Bluetooth.BluetoothGattCharacteristic? characteristic);
[<Android.Runtime.Register("writeCharacteristic", "(Landroid/bluetooth/BluetoothGattCharacteristic;)Z", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.WriteCharacteristic : Android.Bluetooth.BluetoothGattCharacteristic -> bool
Parameters
- characteristic
- BluetoothGattCharacteristic
Characteristic to write on the remote device
Returns
true, if the write operation was initiated successfully
- Attributes
Remarks
Writes a given characteristic and its values to the associated remote device.
Once the write operation has been completed, the BluetoothGattCallback#onCharacteristicWrite
callback is invoked, reporting the result of the operation.
This member is deprecated. Use BluetoothGatt#writeCharacteristic(BluetoothGattCharacteristic, byte[], int)
as this is not memory safe because it relies on a BluetoothGattCharacteristic
object whose underlying fields are subject to change outside this method.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
WriteCharacteristic(BluetoothGattCharacteristic, Byte[], Int32)
Writes a given characteristic and its values to the associated remote device.
[Android.Runtime.Register("writeCharacteristic", "(Landroid/bluetooth/BluetoothGattCharacteristic;[BI)I", "", ApiSince=33)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public int WriteCharacteristic (Android.Bluetooth.BluetoothGattCharacteristic characteristic, byte[] value, int writeType);
[<Android.Runtime.Register("writeCharacteristic", "(Landroid/bluetooth/BluetoothGattCharacteristic;[BI)I", "", ApiSince=33)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.WriteCharacteristic : Android.Bluetooth.BluetoothGattCharacteristic * byte[] * int -> int
Parameters
- characteristic
- BluetoothGattCharacteristic
Characteristic to write on the remote device
- value
- Byte[]
- writeType
- Int32
Returns
whether the characteristic was successfully written to
- Attributes
Remarks
Writes a given characteristic and its values to the associated remote device.
Once the write operation has been completed, the BluetoothGattCallback#onCharacteristicWrite
callback is invoked, reporting the result of the operation.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.