Partager via


BluetoothGattCharacteristic.SetValue Method

Definition

Overloads

SetValue(Byte[])

Updates the locally stored value of this characteristic.

SetValue(String)

Set the locally stored value of this characteristic.

SetValue(Int32, GattFormat, Int32)

Set the locally stored value of this characteristic.

SetValue(Int32, Int32, GattFormat, Int32)

Set the locally stored value of this characteristic.

SetValue(Byte[])

Updates the locally stored value of this characteristic.

[Android.Runtime.Register("setValue", "([B)Z", "GetSetValue_arrayBHandler")]
public virtual bool SetValue (byte[]? value);
[<Android.Runtime.Register("setValue", "([B)Z", "GetSetValue_arrayBHandler")>]
abstract member SetValue : byte[] -> bool
override this.SetValue : byte[] -> bool

Parameters

value
Byte[]

New value for this characteristic

Returns

true if the locally stored value has been set, false if the requested value could not be stored locally.

Attributes

Remarks

Updates the locally stored value of this characteristic.

This function modifies the locally stored cached value of this characteristic. To send the value to the remote device, call BluetoothGatt#writeCharacteristic to send the value to the remote device.

This member is deprecated. Pass the characteristic value directly into BluetoothGatt#writeCharacteristic(BluetoothGattCharacteristic, byte[], int)

Java documentation for android.bluetooth.BluetoothGattCharacteristic.setValue(byte[]).

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

SetValue(String)

Set the locally stored value of this characteristic.

[Android.Runtime.Register("setValue", "(Ljava/lang/String;)Z", "GetSetValue_Ljava_lang_String_Handler")]
public virtual bool SetValue (string? value);
[<Android.Runtime.Register("setValue", "(Ljava/lang/String;)Z", "GetSetValue_Ljava_lang_String_Handler")>]
abstract member SetValue : string -> bool
override this.SetValue : string -> bool

Parameters

value
String

New value for this characteristic

Returns

true if the locally stored value has been set

Attributes

Remarks

Set the locally stored value of this characteristic.

See #setValue(byte[]) for details.

This member is deprecated. Pass the characteristic value directly into BluetoothGatt#writeCharacteristic(BluetoothGattCharacteristic, byte[], int)

Java documentation for android.bluetooth.BluetoothGattCharacteristic.setValue(java.lang.String).

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

SetValue(Int32, GattFormat, Int32)

Set the locally stored value of this characteristic.

[Android.Runtime.Register("setValue", "(III)Z", "GetSetValue_IIIHandler")]
public virtual bool SetValue (int value, Android.Bluetooth.GattFormat formatType, int offset);
[<Android.Runtime.Register("setValue", "(III)Z", "GetSetValue_IIIHandler")>]
abstract member SetValue : int * Android.Bluetooth.GattFormat * int -> bool
override this.SetValue : int * Android.Bluetooth.GattFormat * int -> bool

Parameters

value
Int32

New value for this characteristic

formatType
GattFormat

Integer format type used to transform the value parameter

offset
Int32

Offset at which the value should be placed

Returns

true if the locally stored value has been set

Attributes

Remarks

Set the locally stored value of this characteristic.

See #setValue(byte[]) for details.

This member is deprecated. Pass the characteristic value directly into BluetoothGatt#writeCharacteristic(BluetoothGattCharacteristic, byte[], int)

Java documentation for android.bluetooth.BluetoothGattCharacteristic.setValue(int, int, int).

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

SetValue(Int32, Int32, GattFormat, Int32)

Set the locally stored value of this characteristic.

[Android.Runtime.Register("setValue", "(IIII)Z", "GetSetValue_IIIIHandler")]
public virtual bool SetValue (int mantissa, int exponent, Android.Bluetooth.GattFormat formatType, int offset);
[<Android.Runtime.Register("setValue", "(IIII)Z", "GetSetValue_IIIIHandler")>]
abstract member SetValue : int * int * Android.Bluetooth.GattFormat * int -> bool
override this.SetValue : int * int * Android.Bluetooth.GattFormat * int -> bool

Parameters

mantissa
Int32

Mantissa for this characteristic

exponent
Int32

exponent value for this characteristic

formatType
GattFormat

Float format type used to transform the value parameter

offset
Int32

Offset at which the value should be placed

Returns

true if the locally stored value has been set

Attributes

Remarks

Set the locally stored value of this characteristic.

See #setValue(byte[]) for details.

This member is deprecated. Pass the characteristic value directly into BluetoothGatt#writeCharacteristic(BluetoothGattCharacteristic, byte[], int)

Java documentation for android.bluetooth.BluetoothGattCharacteristic.setValue(int, int, int, int).

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