Материал из Module developer
Перейти к: навигация, поиск

Device.WriteCharacteristic

to write the value of the characteristic

Syntax

IR.CreateDevice(IR.DEVICE_BLE_DEVICE).WriteCharacteristic(in_ble_cha)

input sample description
ID IR.DEVICE_BLE_DEVICE type: Number
the identifier of the BLE scanner
in_ble_cha type: Object
the object of the charactristic
output

-


Example:

var device = IR.CreateDevice(IR.DEVICE_BLE_DEVICE);
device.WriteCharacteristic(in_ble_cha);

It activates the event: IR.EVENT_CHARACTERISTIC_WRITE - the characteristic is written.
Notes:

  • The Value property of the characteristic is used as a container of the new value for sending to the device;
  • The format of the byte array for writing can differ from the array which can be received at reading;
  • The characteristic is required to have CharacteristicPropertyWrite or related.