You are here: Lua Scripting Resources eGuide > Lua Scripting API Reference Guide > Bluetooth® Smart Library > read

20.5.4 read

error = characteristic:read()

Initiates reading the characteristics value. If a listener callback is provided with setValueUpdateListener for this characteristic (see subsection 20.5.2 ) it will be called once the read operation completes and the result can be retrieved via getValue(). There is no guarantee that for every single call to the read function a dedicated call of the callback will happen. The system may decide to combine multiple completions of read requests into a single call of the callback.

Parameter

Type

Description

error

out string (optional)

If successful nil is returned, an error message otherwise

Introduced in platform.apiLevel = '2.5'