Class Characteristic
Represents a Bluetooth characteristic.
Assembly: Meadow.dll
View Source
public abstract class Characteristic : ICharacteristic, IAttribute, IJsonSerializable
Derived:
Meadow.Gateways.Bluetooth.Characteristic<T>
Implements:
Meadow.Gateways.Bluetooth.ICharacteristic, Meadow.Gateways.Bluetooth.IAttribute, Meadow.Gateways.Bluetooth.IJsonSerializable
Properties
DefinitionHandle
Gets or sets the handle of the characteristic definition.
View Source
public ushort DefinitionHandle { get; set; }
ValueHandle
Gets or sets the handle of the characteristic value.
View Source
public ushort ValueHandle { get; set; }
Name
Gets the name of the characteristic (for user reference).
View Source
public string Name { get; }
Uuid
Gets the UUID of the characteristic.
View Source
public string Uuid { get; }
Permissions
Gets the permissions of the characteristic.
View Source
public CharacteristicPermission Permissions { get; }
Properties
Gets the properties of the characteristic.
View Source
public CharacteristicProperty Properties { get; }
MaxLength
Gets the maximum length of the characteristic value.
View Source
public int MaxLength { get; }
Descriptors
Gets the descriptors associated with the characteristic.
View Source
public IDescriptor[] Descriptors { get; }
Methods
HandleDataWrite(byte[])
Handles data write for the characteristic.
View Source
public abstract void HandleDataWrite(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data to be written. |
SetValue(object)
Sets the value of the characteristic.
View Source
public abstract void SetValue(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value to be set. |
RaiseValueSet(object)
Raises the Meadow.Gateways.Bluetooth.Characteristic.ValueSet event, indicating that the value of the characteristic has been set.
View Source
protected void RaiseValueSet(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The data associated with the value set event. |
Events
ValueSet
Occurs when the value of the characteristic is set.
View Source
public event CharacteristicValueSetHandler ValueSet
Event Type
Meadow.Gateways.Bluetooth.CharacteristicValueSetHandler
ServerValueSet
Occurs when the value of the server is set internally (used internally).
View Source
public event ServerValueChangedHandler ServerValueSet
Event Type
Meadow.Gateways.Bluetooth.ServerValueChangedHandler