Home  Contents

bis.query

Bis Core4 Lua Event System

SYNOPSIS

  1. bishandle.queryMTD16 = function(bishandle, mtd16) ... end
  2. bishandle.query = function(bishandle, ptype, data) ... end
  3. bishandle.responseMTD16 = function(bishandle, mtd16) ... end
  4. bishandle.response = function(bishandle, ptype, data) ... end
  5. bishandle.timeout = function(bishandle) ... end
  6. bishandle:clearCallbacks()

DESCRIPTION

When a block of data is received via the BiS protocol, the BiS handle will run a callback function. Any callback will get the original bishandle as first parameter.

Queries received from a master are reported with the query callbacks, form 1 and 2.

Responses received from a slave are reported with the response callbacks, form 3 and 4.

When there is no response from a slave after all tries have timed out, the timeout callback of form 5 is called instead of a response callback.

The function bis:clearCallbacks() will set all callback handlers to nil. Using bis:clearCallbacks() instead of just assigning nil makes sure that all callbacks are cleared, even if future releases of the SDK support more callbacks than documented here.

In peer mode, both query and response callbacks are used. See the introductory document.

NOTES

Callbacks are called from within event:poll().

SEE ALSO