Skip to main content

Class Characteristic<T>

Represents a Bluetooth characteristic with a generic value of type <code class="typeparamref">T</code>.

Assembly: Meadow.dll
View Source
public abstract class Characteristic<T> : Characteristic, ICharacteristic, IAttribute, IJsonSerializable

Inheritance: System.Object -> Meadow.Gateways.Bluetooth.Characteristic

Derived:
Meadow.Gateways.Bluetooth.CharacteristicBool, Meadow.Gateways.Bluetooth.CharacteristicInt32, Meadow.Gateways.Bluetooth.CharacteristicString

Implements:
Meadow.Gateways.Bluetooth.ICharacteristic, Meadow.Gateways.Bluetooth.IAttribute, Meadow.Gateways.Bluetooth.IJsonSerializable

Methods

SerializeValue(T)

Serializes the value of type <code class="typeparamref">T</code> to a byte array.

View Source
protected abstract byte[] SerializeValue(T value)
Returns

System.Byte[]: The byte array representing the serialized value.

Parameters
TypeNameDescription
<T>valueThe value to be serialized.

SetValue(T)

Sets the value of the characteristic.

View Source
public void SetValue(T value)
Parameters
TypeNameDescription
<T>valueThe value to be set.

SetValue(object)

Sets the value of the characteristic.

View Source
public override void SetValue(object value)
Parameters
TypeNameDescription
System.ObjectvalueThe value to be set.

Implements