Object function reference

on_notification

A reference entry for on_notification

Object function · BluetoothDevice

on_notification(function callback) ⇒ boolean

Registers a callback that receives notification maps asynchronously. The callback receives one map containing service, characteristic, and data for each notification.

Example

YASS
function received($notification)
  print($notification)
end function

$device->on_notification(received)