Device Event API

Application may subscribe device events and then wait for event updates.

Subscribe and Unsubscribe

Libre_SetWaitDevice(id)

Subscribe device events.

Parameters:

  • id - Integer, internal device ID.

Libre_ClearWaitDevice(id)

Unsubscribe device events.

Parameters:

  • id - Integer, internal device ID.

Force Device Query

Libre_DeviceQueryAttributes(id, cluster)

Force query device attributes of the given Cluster ID.

Application may need capability to query device status. For example, if a device has electrical measurement capability, an applicaiton may need to periodically query the current and total power consumption of the device.

Once this function is called, application may expect the query response with attribute list. Note the device may be non-responsive for various reasons, e.g. device is broken or unreachable wirelessly. In case a communication failure, the failure will be reported instead of query response.

Parameters:

  • id - Integer, internal device ID.
  • cluster - Integer, the cluster of attribute.