Ishraq Ibne Ashraf

NAME

Tinkerforge::Device - Base class for all Bricks and Bricklets (for internal use only)

FUNCTIONS

register_callback()

Registers a callback with ID $id to the function named $callback.

get_api_version()

Returns the API version (major, minor, revision) of the bindings for this device.

get_response_expected()

Returns the response expected flag for the function specified by the *function_id* parameter. It is *true* if the function is expected to send a response, *false* otherwise.

For getter functions this is enabled by default and cannot be disabled, because those functions will always send a response. For callback configuration functions it is enabled by default too, but can be disabled via the set_response_expected function. For setter functions it is disabled by default and can be enabled.

Enabling the response expected flag for a setter function allows to detect timeouts and other error conditions calls of this setter as well. The device will then send a response for this purpose. If this flag is disabled for a setter function then no response is send and errors are silently ignored, because they cannot be detected.

set_response_expected()

Changes the response expected flag of the function specified by the *function_id* parameter. This flag can only be changed for setter (default value: *false*) and callback configuration functions (default value: *true*). For getter functions it is always enabled and callbacks it is always disabled.

Enabling the response expected flag for a setter function allows to detect timeouts and other error conditions calls of this setter as well. The device will then send a response for this purpose. If this flag is disabled for a setter function then no response is send and errors are silently ignored, because they cannot be detected.

set_response_expected_all()

Changes the response expected flag for all setter and callback configuration functions of this device at once.