Skip to main content

Class Characteristic

Represents a Bluetooth characteristic.

Assembly: Meadow.dll
View Source
Declaration
public abstract class Characteristic : ICharacteristic, IAttribute, IJsonSerializable

Derived:
Meadow.Gateways.Bluetooth.Characteristic<T>

Implements:
Meadow.Gateways.Bluetooth.ICharacteristic

Properties

DefinitionHandle

Gets or sets the handle of the characteristic definition.

View Source
Declaration
public ushort DefinitionHandle { get; set; }

ValueHandle

Gets or sets the handle of the characteristic value.

View Source
Declaration
public ushort ValueHandle { get; set; }

Name

Gets the name of the characteristic (for user reference).

View Source
Declaration
public string Name { get; }

Uuid

Gets the UUID of the characteristic.

View Source
Declaration
public string Uuid { get; }

Permissions

Gets the permissions of the characteristic.

View Source
Declaration
public CharacteristicPermission Permissions { get; }

Properties

Gets the properties of the characteristic.

View Source
Declaration
public CharacteristicProperty Properties { get; }

MaxLength

Gets the maximum length of the characteristic value.

View Source
Declaration
public int MaxLength { get; }

Descriptors

Gets the descriptors associated with the characteristic.

View Source
Declaration
public IDescriptor[] Descriptors { get; }

Methods

HandleDataWrite(byte[])

Handles data write for the characteristic.

View Source
Declaration
public abstract void HandleDataWrite(byte[] data)
Parameters
TypeNameDescription
System.Byte[]dataThe data to be written.

SetValue(object)

Sets the value of the characteristic.

View Source
Declaration
public abstract void SetValue(object value)
Parameters
TypeNameDescription
System.ObjectvalueThe 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
Declaration
protected void RaiseValueSet(object data)
Parameters
TypeNameDescription
System.ObjectdataThe data associated with the value set event.

Events

ValueSet

Occurs when the value of the characteristic is set.

View Source
Declaration
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
Declaration
public event ServerValueChangedHandler ServerValueSet
Event Type

Meadow.Gateways.Bluetooth.ServerValueChangedHandler

Implements