Shell - RED Brick

This is the description of the Shell API bindings for the RED Brick. General information and technical specifications for the RED Brick are summarized in its hardware description.

An installation guide for the Shell API bindings is part of their general description.

Examples

The example code below is Public Domain (CC0 1.0).

API

Possible exit codes for all tinkerforge commands are:

  • 1: interrupted (ctrl+c)
  • 2: syntax error
  • 21: Python 2.5 or newer is required
  • 22: Python argparse module is missing
  • 23: socket error
  • 24: other exception
  • 25: invalid placeholder in format string
  • 26: authentication error
  • 201: timeout occurred
  • 209: invalid argument value
  • 210: function is not supported
  • 211: unknown error

Note

The API documentation for the RED Brick is currently incomplete.

The RED Brick API is meant to be used by the Brick Viewer to implement the offered functionality (getting status information, managing programs etc.). Normal users will not need to use this API, it may only be interesting for power users.

FIXME: explain sessions

The RED Brick API operates on reference counted objects (strings, lists, files, directories, processes and programs) that are identified by their 16bit object ID. Functions that allocate or return an object ID (e.g. allocate-string and get-next-directory-entry) increase the reference count of the returned object. If the object is no longer needed then release-object has to be called to decrease the reference count of the object again. In contrast to allocation and getter functions, the reference count for an object returned by a callback is not increased and release-object must not be called for such an object in response to a callback.

There are functions (e.g. get-file-info) that only return valid objects under certain conditions. This conditions are documented for the specific functions. For invalid objects release-object must not be called.

There are also function (e.g. set-program-stdio-redirection) that have conditionally unused object parameters. Under which conditions an object parameter is unused is documented for the specific functions. For unused object parameters 0 has to be passed as object ID.

The RED Brick API is more complex then the typical Brick API and requires more elaborate error reporting than the TCP/IP protocol can provide with its 2bit error code. Therefore, almost all functions of the RED Brick API return an 8bit error code. Possible error codes are:

  • Success = 0
  • UnknownError = 1
  • InvalidOperation = 2
  • OperationAborted = 3
  • InternalError = 4
  • UnknownSessionID = 5
  • NoFreeSessionID = 6
  • UnknownObjectID = 7
  • NoFreeObjectID = 8
  • ObjectIsLocked = 9
  • NoMoreData = 10
  • WrongListItemType = 11
  • ProgramIsPurged = 12
  • InvalidParameter = 128 (EINVAL)
  • NoFreeMemory = 129 (ENOMEM)
  • NoFreeSpace = 130 (ENOSPC)
  • AccessDenied = 131 (EACCES)
  • AlreadyExists = 132 (EEXIST)
  • DoesNotExist = 133 (ENOENT)
  • Interrupted = 134 (EINTR)
  • IsDirectory = 135 (EISDIR)
  • NotADirectory = 136 (ENOTDIR)
  • WouldBlock = 137 (EWOULDBLOCK)
  • Overflow = 138 (EOVERFLOW)
  • BadFileDescriptor = 139 (EBADF)
  • OutOfRange = 140 (ERANGE)
  • NameTooLong = 141 (ENAMETOOLONG)
  • InvalidSeek = 142 (ESPIPE)
  • NotSupported = 143 (ENOTSUP)
  • TooManyOpenFiles = 144 (EMFILE)

If a function returns an error code other than Success then its other return values (if any) are invalid and must not be used.

The error code InvalidOperation is returned if the requested operation cannot be performed because the current state of the object does not allow it. For example, trying to append an item to a full list object or trying to undefine an already undefined program.

The error code NotSupported is returned if the requested operation can never be performed. For example, trying to append a list object to itself, trying to get the name of a file object with type Pipe or trying to create a directory non-recursively with more than the last part of the directory name referring to non-existing directories.

String objects store UTF-8 encoded data.

Command Structure

The common options of the call and dispatch commands are documented here. The specific command structure is shown below.

tinkerforge call red-brick [<option>..] <uid> <function> [<argument>..]
Parameters:
  • <uid> -- string
  • <function> -- string

The call command is used to call a function of the RED Brick. It can take several options:

  • --help shows help for the specific call command and exits
  • --list-functions shows a list of known functions of the RED Brick and exits
tinkerforge dispatch red-brick [<option>..] <uid> <callback>
Parameters:
  • <uid> -- string
  • <callback> -- string

The dispatch command is used to dispatch a callback of the RED Brick. It can take several options:

  • --help shows help for the specific dispatch command and exits
  • --list-callbacks shows a list of known callbacks of the RED Brick and exits
tinkerforge call red-brick <uid> <function> [<option>..] [<argument>..]
Parameters:
  • <uid> -- string
  • <function> -- string

The <function> to be called can take different options depending of its kind. All functions can take the following options:

  • --help shows help for the specific function and exits

Getter functions can take the following options:

  • --execute <command> shell command line to execute for each incoming response (see section about output formatting for details)

Setter functions can take the following options:

  • --expect-response requests response and waits for it

The --expect-response option for setter functions allows to detect timeouts and other error conditions calls of setters as well. The device will then send a response for this purpose. If this option is not given for a setter function then no response is send and errors are silently ignored, because they cannot be detected.

tinkerforge dispatch red-brick <uid> <callback> [<option>..]
Parameters:
  • <uid> -- string
  • <callback> -- string

The <callback> to be dispatched can take several options:

  • --help shows help for the specific callback and exits
  • --execute <command> shell command line to execute for each incoming response (see section about output formatting for details)

Advanced Functions

tinkerforge call red-brick <uid> create-session <lifetime>
Parameters:
  • <lifetime> -- int
Output:
  • error-code -- int (has symbols)
  • session-id -- int

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> expire-session <session-id>
Parameters:
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> expire-session-unchecked <session-id>
Parameters:
  • <session-id> -- int
Output:

no output

tinkerforge call red-brick <uid> keep-session-alive <session-id> <lifetime>
Parameters:
  • <session-id> -- int
  • <lifetime> -- int
Output:
  • error-code -- int (has symbols)

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> release-object <object-id> <session-id>
Parameters:
  • <object-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)

Decreases the reference count of an object by one and returns the resulting error code. If the reference count reaches zero the object gets destroyed.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> release-object-unchecked <object-id> <session-id>
Parameters:
  • <object-id> -- int
  • <session-id> -- int
Output:

no output

tinkerforge call red-brick <uid> allocate-string <length-to-reserve> <buffer> <session-id>
Parameters:
  • <length-to-reserve> -- int
  • <buffer> -- string
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • string-id -- int

Allocates a new string object, reserves length_to_reserve bytes memory for it and sets up to the first 60 bytes. Set length_to_reserve to the length of the string that should be stored in the string object.

Returns the object ID of the new string object and the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> truncate-string <string-id> <length>
Parameters:
  • <string-id> -- int
  • <length> -- int
Output:
  • error-code -- int (has symbols)

Truncates a string object to length bytes and returns the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-string-length <string-id>
Parameters:
  • <string-id> -- int
Output:
  • error-code -- int (has symbols)
  • length -- int

Returns the length of a string object in bytes and the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> set-string-chunk <string-id> <offset> <buffer>
Parameters:
  • <string-id> -- int
  • <offset> -- int
  • <buffer> -- string
Output:
  • error-code -- int (has symbols)

Sets a chunk of up to 58 bytes in a string object beginning at offset.

Returns the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-string-chunk <string-id> <offset>
Parameters:
  • <string-id> -- int
  • <offset> -- int
Output:
  • error-code -- int (has symbols)
  • buffer -- string

Returns a chunk up to 63 bytes from a string object beginning at offset and returns the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> allocate-list <length-to-reserve> <session-id>
Parameters:
  • <length-to-reserve> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • list-id -- int

Allocates a new list object and reserves memory for length_to_reserve items. Set length_to_reserve to the number of items that should be stored in the list object.

Returns the object ID of the new list object and the resulting error code.

When a list object gets destroyed then the reference count of each object in the list object is decreased by one.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-list-length <list-id>
Parameters:
  • <list-id> -- int
Output:
  • error-code -- int (has symbols)
  • length -- int

Returns the length of a list object in items and the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-list-item <list-id> <index> <session-id>
Parameters:
  • <list-id> -- int
  • <index> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • item-object-id -- int
  • type -- int (has symbols)

Returns the object ID and type of the object stored at index in a list object and returns the resulting error code.

Possible object types are:

  • String = 0
  • List = 1
  • File = 2
  • Directory = 3
  • Process = 4
  • Program = 5

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
  • object-type-string = 0, for type
  • object-type-list = 1, for type
  • object-type-file = 2, for type
  • object-type-directory = 3, for type
  • object-type-process = 4, for type
  • object-type-program = 5, for type
tinkerforge call red-brick <uid> append-to-list <list-id> <item-object-id>
Parameters:
  • <list-id> -- int
  • <item-object-id> -- int
Output:
  • error-code -- int (has symbols)

Appends an object to a list object and increases the reference count of the appended object by one.

Returns the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> remove-from-list <list-id> <index>
Parameters:
  • <list-id> -- int
  • <index> -- int
Output:
  • error-code -- int (has symbols)

Removes the object stored at index from a list object and decreases the reference count of the removed object by one.

Returns the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> open-file <name-string-id> <flags> <permissions> <uid> <gid> <session-id>
Parameters:
  • <name-string-id> -- int
  • <flags> -- int (has symbols)
  • <permissions> -- int (has symbols)
  • <uid> -- int
  • <gid> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • file-id -- int

Opens an existing file or creates a new file and allocates a new file object for it.

FIXME: name has to be absolute

The reference count of the name string object is increased by one. When the file object gets destroyed then the reference count of the name string object is decreased by one. Also the name string object is locked and cannot be modified while the file object holds a reference to it.

The flags parameter takes a ORed combination of the following possible file flags (in hexadecimal notation):

  • ReadOnly = 0x0001 (O_RDONLY)
  • WriteOnly = 0x0002 (O_WRONLY)
  • ReadWrite = 0x0004 (O_RDWR)
  • Append = 0x0008 (O_APPEND)
  • Create = 0x0010 (O_CREAT)
  • Exclusive = 0x0020 (O_EXCL)
  • NonBlocking = 0x0040 (O_NONBLOCK)
  • Truncate = 0x0080 (O_TRUNC)
  • Temporary = 0x0100
  • Replace = 0x0200

FIXME: explain Temporary and Replace flag

The permissions parameter takes a ORed combination of the following possible file permissions (in octal notation) that match the common UNIX permission bits:

  • UserRead = 00400
  • UserWrite = 00200
  • UserExecute = 00100
  • GroupRead = 00040
  • GroupWrite = 00020
  • GroupExecute = 00010
  • OthersRead = 00004
  • OthersWrite = 00002
  • OthersExecute = 00001

Returns the object ID of the new file object and the resulting error code.

The following symbols are available for this function:

  • file-flag-read-only = 1, for <flags>
  • file-flag-write-only = 2, for <flags>
  • file-flag-read-write = 4, for <flags>
  • file-flag-append = 8, for <flags>
  • file-flag-create = 16, for <flags>
  • file-flag-exclusive = 32, for <flags>
  • file-flag-non-blocking = 64, for <flags>
  • file-flag-truncate = 128, for <flags>
  • file-flag-temporary = 256, for <flags>
  • file-flag-replace = 512, for <flags>
  • file-permission-user-all = 448, for <permissions>
  • file-permission-user-read = 256, for <permissions>
  • file-permission-user-write = 128, for <permissions>
  • file-permission-user-execute = 64, for <permissions>
  • file-permission-group-all = 56, for <permissions>
  • file-permission-group-read = 32, for <permissions>
  • file-permission-group-write = 16, for <permissions>
  • file-permission-group-execute = 8, for <permissions>
  • file-permission-others-all = 7, for <permissions>
  • file-permission-others-read = 4, for <permissions>
  • file-permission-others-write = 2, for <permissions>
  • file-permission-others-execute = 1, for <permissions>
  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> create-pipe <flags> <length> <session-id>
Parameters:
  • <flags> -- int (has symbols)
  • <length> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • file-id -- int

Creates a new pipe and allocates a new file object for it.

The flags parameter takes a ORed combination of the following possible pipe flags (in hexadecimal notation):

  • NonBlockingRead = 0x0001
  • NonBlockingWrite = 0x0002

The length of the pipe buffer can be specified with the length parameter in bytes. If length is set to zero, then the default pipe buffer length is used.

Returns the object ID of the new file object and the resulting error code.

The following symbols are available for this function:

  • pipe-flag-non-blocking-read = 1, for <flags>
  • pipe-flag-non-blocking-write = 2, for <flags>
  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-file-info <file-id> <session-id>
Parameters:
  • <file-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • type -- int (has symbols)
  • name-string-id -- int
  • flags -- int
  • permissions -- int (has symbols)
  • uid -- int
  • gid -- int
  • length -- int
  • access-timestamp -- int
  • modification-timestamp -- int
  • status-change-timestamp -- int

Returns various information about a file and the resulting error code.

Possible file types are:

  • Unknown = 0
  • Regular = 1
  • Directory = 2
  • Character = 3
  • Block = 4
  • FIFO = 5
  • Symlink = 6
  • Socket = 7
  • Pipe = 8

If the file type is Pipe then the returned name string object is invalid, because a pipe has no name. Otherwise the returned name string object was used to open or create the file object, as passed to open-file.

The returned flags were used to open or create the file object, as passed to open-file or create-pipe. See the respective function for a list of possible file and pipe flags.

FIXME: everything except flags and length is invalid if file type is Pipe

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
  • file-type-unknown = 0, for type
  • file-type-regular = 1, for type
  • file-type-directory = 2, for type
  • file-type-character = 3, for type
  • file-type-block = 4, for type
  • file-type-fifo = 5, for type
  • file-type-symlink = 6, for type
  • file-type-socket = 7, for type
  • file-type-pipe = 8, for type
  • file-permission-user-all = 448, for permissions
  • file-permission-user-read = 256, for permissions
  • file-permission-user-write = 128, for permissions
  • file-permission-user-execute = 64, for permissions
  • file-permission-group-all = 56, for permissions
  • file-permission-group-read = 32, for permissions
  • file-permission-group-write = 16, for permissions
  • file-permission-group-execute = 8, for permissions
  • file-permission-others-all = 7, for permissions
  • file-permission-others-read = 4, for permissions
  • file-permission-others-write = 2, for permissions
  • file-permission-others-execute = 1, for permissions
tinkerforge call red-brick <uid> read-file <file-id> <length-to-read>
Parameters:
  • <file-id> -- int
  • <length-to-read> -- int
Output:
  • error-code -- int (has symbols)
  • buffer -- int,int,..59x..,int
  • length-read -- int

Reads up to 62 bytes from a file object.

Returns the bytes read, the actual number of bytes read and the resulting error code.

If there is not data to be read, either because the file position reached end-of-file or because there is not data in the pipe, then zero bytes are returned.

If the file object was created by open-file without the NonBlocking flag or by create-pipe without the NonBlockingRead flag then the error code NotSupported is returned.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> read-file-async <file-id> <length-to-read>
Parameters:
  • <file-id> -- int
  • <length-to-read> -- int
Output:

no output

Reads up to 263 - 1 bytes from a file object asynchronously.

Reports the bytes read (in 60 byte chunks), the actual number of bytes read and the resulting error code via the async-file-read callback.

If there is not data to be read, either because the file position reached end-of-file or because there is not data in the pipe, then zero bytes are reported.

If the file object was created by open-file without the NonBlocking flag or by create-pipe without the NonBlockingRead flag then the error code NotSupported is reported via the async-file-read callback.

tinkerforge call red-brick <uid> abort-async-file-read <file-id>
Parameters:
  • <file-id> -- int
Output:
  • error-code -- int (has symbols)

Aborts a read-file-async operation in progress.

Returns the resulting error code.

On success the async-file-read callback will report OperationAborted.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> write-file <file-id> <buffer> <length-to-write>
Parameters:
  • <file-id> -- int
  • <buffer> -- int,int,..58x..,int
  • <length-to-write> -- int
Output:
  • error-code -- int (has symbols)
  • length-written -- int

Writes up to 61 bytes to a file object.

Returns the actual number of bytes written and the resulting error code.

If the file object was created by open-file without the NonBlocking flag or by create-pipe without the NonBlockingWrite flag then the error code NotSupported is returned.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> write-file-unchecked <file-id> <buffer> <length-to-write>
Parameters:
  • <file-id> -- int
  • <buffer> -- int,int,..58x..,int
  • <length-to-write> -- int
Output:

no output

Writes up to 61 bytes to a file object.

Does neither report the actual number of bytes written nor the resulting error code.

If the file object was created by open-file without the NonBlocking flag or by create-pipe without the NonBlockingWrite flag then the write operation will fail silently.

tinkerforge call red-brick <uid> write-file-async <file-id> <buffer> <length-to-write>
Parameters:
  • <file-id> -- int
  • <buffer> -- int,int,..58x..,int
  • <length-to-write> -- int
Output:

no output

Writes up to 61 bytes to a file object.

Reports the actual number of bytes written and the resulting error code via the async-file-write callback.

If the file object was created by open-file without the NonBlocking flag or by create-pipe without the NonBlockingWrite flag then the error code NotSupported is reported via the async-file-write callback.

tinkerforge call red-brick <uid> set-file-position <file-id> <offset> <origin>
Parameters:
  • <file-id> -- int
  • <offset> -- int
  • <origin> -- int (has symbols)
Output:
  • error-code -- int (has symbols)
  • position -- int

Set the current seek position of a file object in bytes relative to origin.

Possible file origins are:

  • Beginning = 0
  • Current = 1
  • End = 2

Returns the resulting absolute seek position and error code.

If the file object was created by create-pipe then it has no seek position and the error code InvalidSeek is returned.

The following symbols are available for this function:

  • file-origin-beginning = 0, for <origin>
  • file-origin-current = 1, for <origin>
  • file-origin-end = 2, for <origin>
  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-file-position <file-id>
Parameters:
  • <file-id> -- int
Output:
  • error-code -- int (has symbols)
  • position -- int

Returns the current seek position of a file object in bytes and returns the resulting error code.

If the file object was created by create-pipe then it has no seek position and the error code InvalidSeek is returned.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> set-file-events <file-id> <events>
Parameters:
  • <file-id> -- int
  • <events> -- int (has symbols)
Output:
  • error-code -- int (has symbols)

The following symbols are available for this function:

  • file-event-readable = 1, for <events>
  • file-event-writable = 2, for <events>
  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-file-events <file-id>
Parameters:
  • <file-id> -- int
Output:
  • error-code -- int (has symbols)
  • events -- int (has symbols)

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
  • file-event-readable = 1, for events
  • file-event-writable = 2, for events
tinkerforge call red-brick <uid> open-directory <name-string-id> <session-id>
Parameters:
  • <name-string-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • directory-id -- int

Opens an existing directory and allocates a new directory object for it.

FIXME: name has to be absolute

The reference count of the name string object is increased by one. When the directory object is destroyed then the reference count of the name string object is decreased by one. Also the name string object is locked and cannot be modified while the directory object holds a reference to it.

Returns the object ID of the new directory object and the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-directory-name <directory-id> <session-id>
Parameters:
  • <directory-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • name-string-id -- int

Returns the name of a directory object, as passed to open-directory, and the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-next-directory-entry <directory-id> <session-id>
Parameters:
  • <directory-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • name-string-id -- int
  • type -- int (has symbols)

Returns the next entry in a directory object and the resulting error code.

If there is not next entry then error code NoMoreData is returned. To rewind a directory object call rewind-directory.

Possible directory entry types are:

  • Unknown = 0
  • Regular = 1
  • Directory = 2
  • Character = 3
  • Block = 4
  • FIFO = 5
  • Symlink = 6
  • Socket = 7

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
  • directory-entry-type-unknown = 0, for type
  • directory-entry-type-regular = 1, for type
  • directory-entry-type-directory = 2, for type
  • directory-entry-type-character = 3, for type
  • directory-entry-type-block = 4, for type
  • directory-entry-type-fifo = 5, for type
  • directory-entry-type-symlink = 6, for type
  • directory-entry-type-socket = 7, for type
tinkerforge call red-brick <uid> rewind-directory <directory-id>
Parameters:
  • <directory-id> -- int
Output:
  • error-code -- int (has symbols)

Rewinds a directory object and returns the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> create-directory <name-string-id> <flags> <permissions> <uid> <gid>
Parameters:
  • <name-string-id> -- int
  • <flags> -- int (has symbols)
  • <permissions> -- int (has symbols)
  • <uid> -- int
  • <gid> -- int
Output:
  • error-code -- int (has symbols)

FIXME: name has to be absolute

The following symbols are available for this function:

  • directory-flag-recursive = 1, for <flags>
  • directory-flag-exclusive = 2, for <flags>
  • file-permission-user-all = 448, for <permissions>
  • file-permission-user-read = 256, for <permissions>
  • file-permission-user-write = 128, for <permissions>
  • file-permission-user-execute = 64, for <permissions>
  • file-permission-group-all = 56, for <permissions>
  • file-permission-group-read = 32, for <permissions>
  • file-permission-group-write = 16, for <permissions>
  • file-permission-group-execute = 8, for <permissions>
  • file-permission-others-all = 7, for <permissions>
  • file-permission-others-read = 4, for <permissions>
  • file-permission-others-write = 2, for <permissions>
  • file-permission-others-execute = 1, for <permissions>
  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-processes <session-id>
Parameters:
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • processes-list-id -- int

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> spawn-process <executable-string-id> <arguments-list-id> <environment-list-id> <working-directory-string-id> <uid> <gid> <stdin-file-id> <stdout-file-id> <stderr-file-id> <session-id>
Parameters:
  • <executable-string-id> -- int
  • <arguments-list-id> -- int
  • <environment-list-id> -- int
  • <working-directory-string-id> -- int
  • <uid> -- int
  • <gid> -- int
  • <stdin-file-id> -- int
  • <stdout-file-id> -- int
  • <stderr-file-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • process-id -- int

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> kill-process <process-id> <signal>
Parameters:
  • <process-id> -- int
  • <signal> -- int (has symbols)
Output:
  • error-code -- int (has symbols)

Sends a UNIX signal to a process object and returns the resulting error code.

Possible UNIX signals are:

  • Interrupt = 2
  • Quit = 3
  • Abort = 6
  • Kill = 9
  • User1 = 10
  • User2 = 12
  • Terminate = 15
  • Continue = 18
  • Stop = 19

The following symbols are available for this function:

  • process-signal-interrupt = 2, for <signal>
  • process-signal-quit = 3, for <signal>
  • process-signal-abort = 6, for <signal>
  • process-signal-kill = 9, for <signal>
  • process-signal-user1 = 10, for <signal>
  • process-signal-user2 = 12, for <signal>
  • process-signal-terminate = 15, for <signal>
  • process-signal-continue = 18, for <signal>
  • process-signal-stop = 19, for <signal>
  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-process-command <process-id> <session-id>
Parameters:
  • <process-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • executable-string-id -- int
  • arguments-list-id -- int
  • environment-list-id -- int
  • working-directory-string-id -- int

Returns the executable, arguments, environment and working directory used to spawn a process object, as passed to spawn-process, and the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-process-identity <process-id>
Parameters:
  • <process-id> -- int
Output:
  • error-code -- int (has symbols)
  • pid -- int
  • uid -- int
  • gid -- int

Returns the process ID and the user and group ID used to spawn a process object, as passed to spawn-process, and the resulting error code.

The process ID is only valid if the state is Running or Stopped, see get-process-state.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-process-stdio <process-id> <session-id>
Parameters:
  • <process-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • stdin-file-id -- int
  • stdout-file-id -- int
  • stderr-file-id -- int

Returns the stdin, stdout and stderr files used to spawn a process object, as passed to spawn-process, and the resulting error code.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-process-state <process-id>
Parameters:
  • <process-id> -- int
Output:
  • error-code -- int (has symbols)
  • state -- int (has symbols)
  • timestamp -- int
  • exit-code -- int

Returns the current state, timestamp and exit code of a process object, and the resulting error code.

Possible process states are:

  • Unknown = 0
  • Running = 1
  • Error = 2
  • Exited = 3
  • Killed = 4
  • Stopped = 5

The timestamp represents the UNIX time since when the process is in its current state.

The exit code is only valid if the state is Error, Exited, Killed or Stopped and has different meanings depending on the state:

  • Error: error code for error occurred while spawning the process (see below)
  • Exited: exit status of the process
  • Killed: UNIX signal number used to kill the process
  • Stopped: UNIX signal number used to stop the process

Possible exit/error codes in Error state are:

  • InternalError = 125
  • CannotExecute = 126
  • DoesNotExist = 127

The CannotExecute error can be caused by the executable being opened for writing.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
  • process-state-unknown = 0, for state
  • process-state-running = 1, for state
  • process-state-error = 2, for state
  • process-state-exited = 3, for state
  • process-state-killed = 4, for state
  • process-state-stopped = 5, for state
tinkerforge call red-brick <uid> get-programs <session-id>
Parameters:
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • programs-list-id -- int

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> define-program <identifier-string-id> <session-id>
Parameters:
  • <identifier-string-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • program-id -- int

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> purge-program <program-id> <cookie>
Parameters:
  • <program-id> -- int
  • <cookie> -- int
Output:
  • error-code -- int (has symbols)

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-program-identifier <program-id> <session-id>
Parameters:
  • <program-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • identifier-string-id -- int

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-program-root-directory <program-id> <session-id>
Parameters:
  • <program-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • root-directory-string-id -- int

FIXME: root directory is absolute: <home>/programs/<identifier>

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> set-program-command <program-id> <executable-string-id> <arguments-list-id> <environment-list-id> <working-directory-string-id>
Parameters:
  • <program-id> -- int
  • <executable-string-id> -- int
  • <arguments-list-id> -- int
  • <environment-list-id> -- int
  • <working-directory-string-id> -- int
Output:
  • error-code -- int (has symbols)

FIXME: working directory is relative to <home>/programs/<identifier>/bin

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-program-command <program-id> <session-id>
Parameters:
  • <program-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • executable-string-id -- int
  • arguments-list-id -- int
  • environment-list-id -- int
  • working-directory-string-id -- int

FIXME: working directory is relative to <home>/programs/<identifier>/bin

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> set-program-stdio-redirection <program-id> <stdin-redirection> <stdin-file-name-string-id> <stdout-redirection> <stdout-file-name-string-id> <stderr-redirection> <stderr-file-name-string-id>
Parameters:
  • <program-id> -- int
  • <stdin-redirection> -- int (has symbols)
  • <stdin-file-name-string-id> -- int
  • <stdout-redirection> -- int (has symbols)
  • <stdout-file-name-string-id> -- int
  • <stderr-redirection> -- int (has symbols)
  • <stderr-file-name-string-id> -- int
Output:
  • error-code -- int (has symbols)

FIXME: stdio file names are relative to <home>/programs/<identifier>/bin

The following symbols are available for this function:

  • program-stdio-redirection-dev-null = 0, for <stdin-redirection>, <stdout-redirection> and <stderr-redirection>
  • program-stdio-redirection-pipe = 1, for <stdin-redirection>, <stdout-redirection> and <stderr-redirection>
  • program-stdio-redirection-file = 2, for <stdin-redirection>, <stdout-redirection> and <stderr-redirection>
  • program-stdio-redirection-individual-log = 3, for <stdin-redirection>, <stdout-redirection> and <stderr-redirection>
  • program-stdio-redirection-continuous-log = 4, for <stdin-redirection>, <stdout-redirection> and <stderr-redirection>
  • program-stdio-redirection-stdout = 5, for <stdin-redirection>, <stdout-redirection> and <stderr-redirection>
  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-program-stdio-redirection <program-id> <session-id>
Parameters:
  • <program-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • stdin-redirection -- int (has symbols)
  • stdin-file-name-string-id -- int
  • stdout-redirection -- int (has symbols)
  • stdout-file-name-string-id -- int
  • stderr-redirection -- int (has symbols)
  • stderr-file-name-string-id -- int

FIXME: stdio file names are relative to <home>/programs/<identifier>/bin

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
  • program-stdio-redirection-dev-null = 0, for stdin-redirection, stdout-redirection and stderr-redirection
  • program-stdio-redirection-pipe = 1, for stdin-redirection, stdout-redirection and stderr-redirection
  • program-stdio-redirection-file = 2, for stdin-redirection, stdout-redirection and stderr-redirection
  • program-stdio-redirection-individual-log = 3, for stdin-redirection, stdout-redirection and stderr-redirection
  • program-stdio-redirection-continuous-log = 4, for stdin-redirection, stdout-redirection and stderr-redirection
  • program-stdio-redirection-stdout = 5, for stdin-redirection, stdout-redirection and stderr-redirection
tinkerforge call red-brick <uid> set-program-schedule <program-id> <start-mode> <continue-after-error> <start-interval> <start-fields-string-id>
Parameters:
  • <program-id> -- int
  • <start-mode> -- int (has symbols)
  • <continue-after-error> -- bool
  • <start-interval> -- int
  • <start-fields-string-id> -- int
Output:
  • error-code -- int (has symbols)

The following symbols are available for this function:

  • program-start-mode-never = 0, for <start-mode>
  • program-start-mode-always = 1, for <start-mode>
  • program-start-mode-interval = 2, for <start-mode>
  • program-start-mode-cron = 3, for <start-mode>
  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-program-schedule <program-id> <session-id>
Parameters:
  • <program-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • start-mode -- int (has symbols)
  • continue-after-error -- bool
  • start-interval -- int
  • start-fields-string-id -- int

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
  • program-start-mode-never = 0, for start-mode
  • program-start-mode-always = 1, for start-mode
  • program-start-mode-interval = 2, for start-mode
  • program-start-mode-cron = 3, for start-mode
tinkerforge call red-brick <uid> get-program-scheduler-state <program-id> <session-id>
Parameters:
  • <program-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • state -- int (has symbols)
  • timestamp -- int
  • message-string-id -- int

FIXME: message is currently valid in error-occurred state only

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
  • program-scheduler-state-stopped = 0, for state
  • program-scheduler-state-running = 1, for state
tinkerforge call red-brick <uid> continue-program-schedule <program-id>
Parameters:
  • <program-id> -- int
Output:
  • error-code -- int (has symbols)

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> start-program <program-id>
Parameters:
  • <program-id> -- int
Output:
  • error-code -- int (has symbols)

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-last-spawned-program-process <program-id> <session-id>
Parameters:
  • <program-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • process-id -- int
  • timestamp -- int

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-custom-program-option-names <program-id> <session-id>
Parameters:
  • <program-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • names-list-id -- int

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> set-custom-program-option-value <program-id> <name-string-id> <value-string-id>
Parameters:
  • <program-id> -- int
  • <name-string-id> -- int
  • <value-string-id> -- int
Output:
  • error-code -- int (has symbols)

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-custom-program-option-value <program-id> <name-string-id> <session-id>
Parameters:
  • <program-id> -- int
  • <name-string-id> -- int
  • <session-id> -- int
Output:
  • error-code -- int (has symbols)
  • value-string-id -- int

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> remove-custom-program-option <program-id> <name-string-id>
Parameters:
  • <program-id> -- int
  • <name-string-id> -- int
Output:
  • error-code -- int (has symbols)

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge call red-brick <uid> get-identity
Output:
  • uid -- string
  • connected-uid -- string
  • position -- char
  • hardware-version -- int,int,int
  • firmware-version -- int,int,int
  • device-identifier -- int (has symbols)

Returns the UID, the UID where the Brick is connected to, the position, the hardware and firmware version as well as the device identifier.

The position can be '0'-'8' (stack position).

The device identifier numbers can be found here

Callbacks

Callbacks can be used to receive time critical or recurring data from the device:

tinkerforge dispatch red-brick <uid> example

The available callbacks are described below.

Note

Using callbacks for recurring events is always preferred compared to using getters. It will use less USB bandwidth and the latency will be a lot better, since there is no round trip time.

tinkerforge dispatch red-brick <uid> async-file-read
Output:
  • file-id -- int
  • error-code -- int (has symbols)
  • buffer -- int,int,..57x..,int
  • length-read -- int

This callback reports the result of a call to the read-file-async function.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge dispatch red-brick <uid> async-file-write
Output:
  • file-id -- int
  • error-code -- int (has symbols)
  • length-written -- int

This callback reports the result of a call to the write-file-async function.

The following symbols are available for this function:

  • error-code-success = 0, for error-code
  • error-code-unknown-error = 1, for error-code
  • error-code-invalid-operation = 2, for error-code
  • error-code-operation-aborted = 3, for error-code
  • error-code-internal-error = 4, for error-code
  • error-code-unknown-session-id = 5, for error-code
  • error-code-no-free-session-id = 6, for error-code
  • error-code-unknown-object-id = 7, for error-code
  • error-code-no-free-object-id = 8, for error-code
  • error-code-object-is-locked = 9, for error-code
  • error-code-no-more-data = 10, for error-code
  • error-code-wrong-list-item-type = 11, for error-code
  • error-code-program-is-purged = 12, for error-code
  • error-code-invalid-parameter = 128, for error-code
  • error-code-no-free-memory = 129, for error-code
  • error-code-no-free-space = 130, for error-code
  • error-code-access-denied = 121, for error-code
  • error-code-already-exists = 132, for error-code
  • error-code-does-not-exist = 133, for error-code
  • error-code-interrupted = 134, for error-code
  • error-code-is-directory = 135, for error-code
  • error-code-not-a-directory = 136, for error-code
  • error-code-would-block = 137, for error-code
  • error-code-overflow = 138, for error-code
  • error-code-bad-file-descriptor = 139, for error-code
  • error-code-out-of-range = 140, for error-code
  • error-code-name-too-long = 141, for error-code
  • error-code-invalid-seek = 142, for error-code
  • error-code-not-supported = 143, for error-code
  • error-code-too-many-open-files = 144, for error-code
tinkerforge dispatch red-brick <uid> file-events-occurred
Output:
  • file-id -- int
  • events -- int (has symbols)

The following symbols are available for this function:

  • file-event-readable = 1, for events
  • file-event-writable = 2, for events
tinkerforge dispatch red-brick <uid> process-state-changed
Output:
  • process-id -- int
  • state -- int (has symbols)
  • timestamp -- int
  • exit-code -- int

The following symbols are available for this function:

  • process-state-unknown = 0, for state
  • process-state-running = 1, for state
  • process-state-error = 2, for state
  • process-state-exited = 3, for state
  • process-state-killed = 4, for state
  • process-state-stopped = 5, for state
tinkerforge dispatch red-brick <uid> program-scheduler-state-changed
Output:
  • program-id -- int
tinkerforge dispatch red-brick <uid> program-process-spawned
Output:
  • program-id -- int