Class: Toybox.BluetoothLowEnergy.Characteristic

Overview

Encapsulates a characteristic on a service

Since:

API Level 3.1.0

Instance Method Summary collapse

Instance Method Details

getDescriptor(uuid as BluetoothLowEnergy.Uuid) as BluetoothLowEnergy.Descriptor or Null

Retrieves the Descriptor with a specified UUID

Parameters:

Returns:

  • BluetoothLowEnergy.Descriptor

    The Descriptor represented by the UUID provided or, null if the descriptor does not exist or the UUID has not be registered.

Since:

API Level 3.1.0

getDescriptors() as BluetoothLowEnergy.Iterator

Retrieves an Iterator over the Descriptors discovered in the Characteristic

This will only provide descriptors that have been registered using registerProfile()

Returns:

Since:

API Level 3.1.0

getService() as BluetoothLowEnergy.Service

Retrieves the Characteristic's Service

Retrieve the Service that this characteristic belongs to

Returns:

Since:

API Level 3.1.0

getUuid() as BluetoothLowEnergy.Uuid

Return the UUID of the Characteristic

Returns:

Since:

API Level 3.1.0

requestRead() as Void

Requests a read operation on the characteristic

Once the operation is completed, onCharacteristicRead() will be called on the registered BleDelegate with the status of the operation

Support for long reads is not implemented.

Since:

API Level 3.1.0

requestWrite(value as Lang.ByteArray, options as { :writeType as BluetoothLowEnergy.WriteType }) as Void

Requests a write operation

Once the operation is completed, onCharacteristicWrite() will be called on the registered BleDelegate with the status of the operation

Support for long writes is not implemented. Requesting a write on a characteristic longer than 20 bytes will cause an InvalidRequestException

Parameters:

Since:

API Level 3.1.0

Throws:


Generated Dec 11, 2024, 8:58:42 AM