BluetoothGattCharacteristic.SetValue 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| SetValue(Byte[]) |
更新此特征的本地存储值。 |
| SetValue(String) |
设置此特征的本地存储值。 |
| SetValue(Int32, GattFormat, Int32) |
设置此特征的本地存储值。 |
| SetValue(Int32, Int32, GattFormat, Int32) |
设置此特征的本地存储值。 |
SetValue(Byte[])
更新此特征的本地存储值。
[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
参数
- value
- Byte[]
此特征的新值
返回
如果已设置本地存储值,则为 true;如果请求的值无法本地存储,则为 false。
- 特性
注解
更新此特征的本地存储值。
此函数修改此特征的本地存储缓存值。 若要将值发送到远程设备,请调用 BluetoothGatt#writeCharacteristic 以将值发送到远程设备。
此成员已弃用。 将特征值直接传递到 BluetoothGatt#writeCharacteristic(BluetoothGattCharacteristic, byte[], int)
Java文档android.bluetooth.BluetoothGattCharacteristic.setValue(byte[])。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
SetValue(String)
设置此特征的本地存储值。
[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
参数
- value
- String
此特征的新值
返回
如果已设置本地存储的值,则为 true
- 特性
注解
设置此特征的本地存储值。
有关详细信息,请参阅#setValue(byte[])。
此成员已弃用。 将特征值直接传递到 BluetoothGatt#writeCharacteristic(BluetoothGattCharacteristic, byte[], int)
Java文档android.bluetooth.BluetoothGattCharacteristic.setValue(java.lang.String)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
SetValue(Int32, GattFormat, Int32)
设置此特征的本地存储值。
[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
参数
- value
- Int32
此特征的新值
- formatType
- GattFormat
用于转换值参数的整数格式类型
- offset
- Int32
应放置值的偏移量
返回
如果已设置本地存储的值,则为 true
- 特性
注解
设置此特征的本地存储值。
有关详细信息,请参阅#setValue(byte[])。
此成员已弃用。 将特征值直接传递到 BluetoothGatt#writeCharacteristic(BluetoothGattCharacteristic, byte[], int)
Java文档android.bluetooth.BluetoothGattCharacteristic.setValue(int, int, int)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
SetValue(Int32, Int32, GattFormat, Int32)
设置此特征的本地存储值。
[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
参数
- mantissa
- Int32
此特征的 Mantissa
- exponent
- Int32
此特征的指数值
- formatType
- GattFormat
用于转换值参数的浮点格式类型
- offset
- Int32
应放置值的偏移量
返回
如果已设置本地存储的值,则为 true
- 特性
注解
设置此特征的本地存储值。
有关详细信息,请参阅#setValue(byte[])。
此成员已弃用。 将特征值直接传递到 BluetoothGatt#writeCharacteristic(BluetoothGattCharacteristic, byte[], int)
Java文档android.bluetooth.BluetoothGattCharacteristic.setValue(int, int, int, int)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。