Java - RED Brick

This is the description of the Java 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 Java API bindings is part of their general description.

Examples

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

Start Program

Download (ExampleStartProgram.java)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import com.tinkerforge.BrickRED;
import com.tinkerforge.IPConnection;
import com.tinkerforge.TinkerforgeException;

public class ExampleStartProgram {
    private static final String HOST = "localhost";
    private static final int PORT = 4223;
    private static final String UID = "3dfEZD"; // Change to your UID
    private static final String PROGRAM = "test"; // Change to your program identifier

    private static void checkError(short errorCode) {
        if (errorCode != 0) {
            throw new RuntimeException("RED Brick error occurred: " + errorCode);
        }
    }

    private static boolean startProgram(BrickRED red, String identifier)
      throws TinkerforgeException {
        // Create session and get program list
        BrickRED.CreateSession session = red.createSession(10);
        checkError(session.errorCode);

        BrickRED.Programs programs = red.getPrograms(session.sessionId);
        checkError(programs.errorCode);

        BrickRED.ListLength programCount = red.getListLength(programs.programsListId);
        checkError(programCount.errorCode);

        // Iterate program list to find the one to start
        boolean started = false;

        for (int i = 0; i < programCount.length; i++) {
            BrickRED.ListItem program = red.getListItem(programs.programsListId, i,
                                                        session.sessionId);
            checkError(program.errorCode);

            // Get program identifer string
            BrickRED.ProgramIdentifier programIdentifier =
              red.getProgramIdentifier(program.itemObjectId, session.sessionId);
            checkError(programIdentifier.errorCode);

            BrickRED.StringLength stringLength =
              red.getStringLength(programIdentifier.identifierStringId);
            checkError(stringLength.errorCode);

            String stringData = "";

            while (stringData.length() < stringLength.length) {
                BrickRED.StringChunk chunk =
                  red.getStringChunk(programIdentifier.identifierStringId,
                                     stringData.length());
                checkError(chunk.errorCode);

                stringData += chunk.buffer;
            }

            checkError(red.releaseObject(programIdentifier.identifierStringId,
                                         session.sessionId));

            // Check if this is the program to be started
            if (stringData.equalsIgnoreCase(identifier)) {
                checkError(red.startProgram(program.itemObjectId));
                started = true;
            }

            checkError(red.releaseObject(program.itemObjectId, session.sessionId));

            if (started) {
                break;
            }
        }

        checkError(red.releaseObject(programs.programsListId, session.sessionId));
        checkError(red.expireSession(session.sessionId));

        return started;
    }

    // Note: To make the example code cleaner we do not handle exceptions. Exceptions you
    //       might normally want to catch are described in the documentation
    public static void main(String args[]) throws Exception {
        IPConnection ipcon = new IPConnection(); // Create IP connection
        BrickRED red = new BrickRED(UID, ipcon); // Create device object

        ipcon.connect(HOST, PORT); // Connect to brickd
        // Don't use device before ipcon is connected

        if (startProgram(red, PROGRAM)) {
            System.out.println("Started RED Brick program: " + PROGRAM);
        } else {
            System.out.println("RED Brick program not found: " + PROGRAM);
        }

        System.out.println("Press key to exit"); System.in.read();
        ipcon.disconnect();
    }
}

API

Generally, every method of the Java bindings that returns a value can throw a TimeoutException. This exception gets thrown if the device did not respond. If a cable based connection is used, it is unlikely that this exception gets thrown (assuming nobody unplugs the device). However, if a wireless connection is used, timeouts will occur if the distance to the device gets too big.

Beside the TimeoutException there is also a NotConnectedException that is thrown if a method needs to communicate with the device while the IP Connection is not connected.

Since Java does not support multiple return values and return by reference is not possible for primitive types, we use small classes that only consist of member variables. The member variables of the returned objects are described in the corresponding method descriptions.

The package for all Brick/Bricklet bindings and the IP Connection is com.tinkerforge.*

All methods listed below are thread-safe.

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. allocateString() and getNextDirectoryEntry()) increase the reference count of the returned object. If the object is no longer needed then releaseObject() 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 releaseObject() must not be called for such an object in response to a callback.

There are functions (e.g. getFileInfo()) that only return valid objects under certain conditions. This conditions are documented for the specific functions. For invalid objects releaseObject() must not be called.

There are also function (e.g. setProgramStdioRedirection()) 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.

Advanced Functions

public BrickRED.CreateSession createSession(long lifetime)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int sessionId.

public short expireSession(int sessionId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public void expireSessionUnchecked(int sessionId)
public short keepSessionAlive(int sessionId, long lifetime)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public short releaseObject(int objectId, int sessionId)

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 constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public void releaseObjectUnchecked(int objectId, int sessionId)
public BrickRED.AllocateString allocateString(long lengthToReserve, String buffer, int sessionId)

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 constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int stringId.

public short truncateString(int stringId, long length)

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.StringLength getStringLength(int stringId)

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and long length.

public short setStringChunk(int stringId, long offset, String buffer)

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

Returns the resulting error code.

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.StringChunk getStringChunk(int stringId, long offset)

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and String buffer.

public BrickRED.AllocateList allocateList(int lengthToReserve, int sessionId)

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 constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int listId.

public BrickRED.ListLength getListLength(int listId)

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int length.

public BrickRED.ListItem getListItem(int listId, int index, int sessionId)

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 constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
  • BrickRED.OBJECT_TYPE_STRING = 0
  • BrickRED.OBJECT_TYPE_LIST = 1
  • BrickRED.OBJECT_TYPE_FILE = 2
  • BrickRED.OBJECT_TYPE_DIRECTORY = 3
  • BrickRED.OBJECT_TYPE_PROCESS = 4
  • BrickRED.OBJECT_TYPE_PROGRAM = 5

The returned object has the public member variables short errorCode, int itemObjectId and short type.

public short appendToList(int listId, int itemObjectId)

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 constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public short removeFromList(int listId, int index)

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 constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.OpenFile openFile(int nameStringId, long flags, int permissions, long uid, long gid, int sessionId)

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 constants are available for this function:

  • BrickRED.FILE_FLAG_READ_ONLY = 1
  • BrickRED.FILE_FLAG_WRITE_ONLY = 2
  • BrickRED.FILE_FLAG_READ_WRITE = 4
  • BrickRED.FILE_FLAG_APPEND = 8
  • BrickRED.FILE_FLAG_CREATE = 16
  • BrickRED.FILE_FLAG_EXCLUSIVE = 32
  • BrickRED.FILE_FLAG_NON_BLOCKING = 64
  • BrickRED.FILE_FLAG_TRUNCATE = 128
  • BrickRED.FILE_FLAG_TEMPORARY = 256
  • BrickRED.FILE_FLAG_REPLACE = 512
  • BrickRED.FILE_PERMISSION_USER_ALL = 448
  • BrickRED.FILE_PERMISSION_USER_READ = 256
  • BrickRED.FILE_PERMISSION_USER_WRITE = 128
  • BrickRED.FILE_PERMISSION_USER_EXECUTE = 64
  • BrickRED.FILE_PERMISSION_GROUP_ALL = 56
  • BrickRED.FILE_PERMISSION_GROUP_READ = 32
  • BrickRED.FILE_PERMISSION_GROUP_WRITE = 16
  • BrickRED.FILE_PERMISSION_GROUP_EXECUTE = 8
  • BrickRED.FILE_PERMISSION_OTHERS_ALL = 7
  • BrickRED.FILE_PERMISSION_OTHERS_READ = 4
  • BrickRED.FILE_PERMISSION_OTHERS_WRITE = 2
  • BrickRED.FILE_PERMISSION_OTHERS_EXECUTE = 1
  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int fileId.

public BrickRED.CreatePipe createPipe(long flags, long length, int sessionId)

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 constants are available for this function:

  • BrickRED.PIPE_FLAG_NON_BLOCKING_READ = 1
  • BrickRED.PIPE_FLAG_NON_BLOCKING_WRITE = 2
  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int fileId.

public BrickRED.FileInfo getFileInfo(int fileId, int sessionId)

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 openFile().

The returned flags were used to open or create the file object, as passed to openFile() or createPipe(). 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 constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
  • BrickRED.FILE_TYPE_UNKNOWN = 0
  • BrickRED.FILE_TYPE_REGULAR = 1
  • BrickRED.FILE_TYPE_DIRECTORY = 2
  • BrickRED.FILE_TYPE_CHARACTER = 3
  • BrickRED.FILE_TYPE_BLOCK = 4
  • BrickRED.FILE_TYPE_FIFO = 5
  • BrickRED.FILE_TYPE_SYMLINK = 6
  • BrickRED.FILE_TYPE_SOCKET = 7
  • BrickRED.FILE_TYPE_PIPE = 8
  • BrickRED.FILE_PERMISSION_USER_ALL = 448
  • BrickRED.FILE_PERMISSION_USER_READ = 256
  • BrickRED.FILE_PERMISSION_USER_WRITE = 128
  • BrickRED.FILE_PERMISSION_USER_EXECUTE = 64
  • BrickRED.FILE_PERMISSION_GROUP_ALL = 56
  • BrickRED.FILE_PERMISSION_GROUP_READ = 32
  • BrickRED.FILE_PERMISSION_GROUP_WRITE = 16
  • BrickRED.FILE_PERMISSION_GROUP_EXECUTE = 8
  • BrickRED.FILE_PERMISSION_OTHERS_ALL = 7
  • BrickRED.FILE_PERMISSION_OTHERS_READ = 4
  • BrickRED.FILE_PERMISSION_OTHERS_WRITE = 2
  • BrickRED.FILE_PERMISSION_OTHERS_EXECUTE = 1

The returned object has the public member variables short errorCode, short type, int nameStringId, long flags, int permissions, long uid, long gid, long length, long accessTimestamp, long modificationTimestamp and long statusChangeTimestamp.

public BrickRED.ReadFile readFile(int fileId, short lengthToRead)

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 openFile() without the NonBlocking flag or by createPipe() without the NonBlockingRead flag then the error code NotSupported is returned.

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode, short[] buffer and short lengthRead.

public void readFileAsync(int fileId, long lengthToRead)

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 AsyncFileReadListener listener.

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 openFile() without the NonBlocking flag or by createPipe() without the NonBlockingRead flag then the error code NotSupported is reported via the AsyncFileReadListener listener.

public short abortAsyncFileRead(int fileId)

Aborts a readFileAsync() operation in progress.

Returns the resulting error code.

On success the AsyncFileReadListener listener will report OperationAborted.

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.WriteFile writeFile(int fileId, short[] buffer, short lengthToWrite)

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 openFile() without the NonBlocking flag or by createPipe() without the NonBlockingWrite flag then the error code NotSupported is returned.

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and short lengthWritten.

public void writeFileUnchecked(int fileId, short[] buffer, short lengthToWrite)

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 openFile() without the NonBlocking flag or by createPipe() without the NonBlockingWrite flag then the write operation will fail silently.

public void writeFileAsync(int fileId, short[] buffer, short lengthToWrite)

Writes up to 61 bytes to a file object.

Reports the actual number of bytes written and the resulting error code via the AsyncFileWriteListener listener.

If the file object was created by openFile() without the NonBlocking flag or by createPipe() without the NonBlockingWrite flag then the error code NotSupported is reported via the AsyncFileWriteListener listener.

public BrickRED.SetFilePosition setFilePosition(int fileId, long offset, short origin)

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 createPipe() then it has no seek position and the error code InvalidSeek is returned.

The following constants are available for this function:

  • BrickRED.FILE_ORIGIN_BEGINNING = 0
  • BrickRED.FILE_ORIGIN_CURRENT = 1
  • BrickRED.FILE_ORIGIN_END = 2
  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and long position.

public BrickRED.FilePosition getFilePosition(int fileId)

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

If the file object was created by createPipe() then it has no seek position and the error code InvalidSeek is returned.

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and long position.

public short setFileEvents(int fileId, int events)

The following constants are available for this function:

  • BrickRED.FILE_EVENT_READABLE = 1
  • BrickRED.FILE_EVENT_WRITABLE = 2
  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.FileEvents getFileEvents(int fileId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
  • BrickRED.FILE_EVENT_READABLE = 1
  • BrickRED.FILE_EVENT_WRITABLE = 2

The returned object has the public member variables short errorCode and int events.

public BrickRED.OpenDirectory openDirectory(int nameStringId, int sessionId)

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 constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int directoryId.

public BrickRED.DirectoryName getDirectoryName(int directoryId, int sessionId)

Returns the name of a directory object, as passed to openDirectory(), and the resulting error code.

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int nameStringId.

public BrickRED.NextDirectoryEntry getNextDirectoryEntry(int directoryId, int sessionId)

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 rewindDirectory().

Possible directory entry types are:

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
  • BrickRED.DIRECTORY_ENTRY_TYPE_UNKNOWN = 0
  • BrickRED.DIRECTORY_ENTRY_TYPE_REGULAR = 1
  • BrickRED.DIRECTORY_ENTRY_TYPE_DIRECTORY = 2
  • BrickRED.DIRECTORY_ENTRY_TYPE_CHARACTER = 3
  • BrickRED.DIRECTORY_ENTRY_TYPE_BLOCK = 4
  • BrickRED.DIRECTORY_ENTRY_TYPE_FIFO = 5
  • BrickRED.DIRECTORY_ENTRY_TYPE_SYMLINK = 6
  • BrickRED.DIRECTORY_ENTRY_TYPE_SOCKET = 7

The returned object has the public member variables short errorCode, int nameStringId and short type.

public short rewindDirectory(int directoryId)

Rewinds a directory object and returns the resulting error code.

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public short createDirectory(int nameStringId, long flags, int permissions, long uid, long gid)

FIXME: name has to be absolute

The following constants are available for this function:

  • BrickRED.DIRECTORY_FLAG_RECURSIVE = 1
  • BrickRED.DIRECTORY_FLAG_EXCLUSIVE = 2
  • BrickRED.FILE_PERMISSION_USER_ALL = 448
  • BrickRED.FILE_PERMISSION_USER_READ = 256
  • BrickRED.FILE_PERMISSION_USER_WRITE = 128
  • BrickRED.FILE_PERMISSION_USER_EXECUTE = 64
  • BrickRED.FILE_PERMISSION_GROUP_ALL = 56
  • BrickRED.FILE_PERMISSION_GROUP_READ = 32
  • BrickRED.FILE_PERMISSION_GROUP_WRITE = 16
  • BrickRED.FILE_PERMISSION_GROUP_EXECUTE = 8
  • BrickRED.FILE_PERMISSION_OTHERS_ALL = 7
  • BrickRED.FILE_PERMISSION_OTHERS_READ = 4
  • BrickRED.FILE_PERMISSION_OTHERS_WRITE = 2
  • BrickRED.FILE_PERMISSION_OTHERS_EXECUTE = 1
  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.Processes getProcesses(int sessionId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int processesListId.

public BrickRED.SpawnProcess spawnProcess(int executableStringId, int argumentsListId, int environmentListId, int workingDirectoryStringId, long uid, long gid, int stdinFileId, int stdoutFileId, int stderrFileId, int sessionId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int processId.

public short killProcess(int processId, short signal)

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 constants are available for this function:

  • BrickRED.PROCESS_SIGNAL_INTERRUPT = 2
  • BrickRED.PROCESS_SIGNAL_QUIT = 3
  • BrickRED.PROCESS_SIGNAL_ABORT = 6
  • BrickRED.PROCESS_SIGNAL_KILL = 9
  • BrickRED.PROCESS_SIGNAL_USER1 = 10
  • BrickRED.PROCESS_SIGNAL_USER2 = 12
  • BrickRED.PROCESS_SIGNAL_TERMINATE = 15
  • BrickRED.PROCESS_SIGNAL_CONTINUE = 18
  • BrickRED.PROCESS_SIGNAL_STOP = 19
  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.ProcessCommand getProcessCommand(int processId, int sessionId)

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode, int executableStringId, int argumentsListId, int environmentListId and int workingDirectoryStringId.

public BrickRED.ProcessIdentity getProcessIdentity(int processId)

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

The process ID is only valid if the state is Running or Stopped, see getProcessState().

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode, long pid, long uid and long gid.

public BrickRED.ProcessStdio getProcessStdio(int processId, int sessionId)

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode, int stdinFileId, int stdoutFileId and int stderrFileId.

public BrickRED.ProcessState getProcessState(int processId)

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 constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
  • BrickRED.PROCESS_STATE_UNKNOWN = 0
  • BrickRED.PROCESS_STATE_RUNNING = 1
  • BrickRED.PROCESS_STATE_ERROR = 2
  • BrickRED.PROCESS_STATE_EXITED = 3
  • BrickRED.PROCESS_STATE_KILLED = 4
  • BrickRED.PROCESS_STATE_STOPPED = 5

The returned object has the public member variables short errorCode, short state, long timestamp and short exitCode.

public BrickRED.Programs getPrograms(int sessionId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int programsListId.

public BrickRED.DefineProgram defineProgram(int identifierStringId, int sessionId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int programId.

public short purgeProgram(int programId, long cookie)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.ProgramIdentifier getProgramIdentifier(int programId, int sessionId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int identifierStringId.

public BrickRED.ProgramRootDirectory getProgramRootDirectory(int programId, int sessionId)

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int rootDirectoryStringId.

public short setProgramCommand(int programId, int executableStringId, int argumentsListId, int environmentListId, int workingDirectoryStringId)

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.ProgramCommand getProgramCommand(int programId, int sessionId)

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode, int executableStringId, int argumentsListId, int environmentListId and int workingDirectoryStringId.

public short setProgramStdioRedirection(int programId, short stdinRedirection, int stdinFileNameStringId, short stdoutRedirection, int stdoutFileNameStringId, short stderrRedirection, int stderrFileNameStringId)

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

The following constants are available for this function:

  • BrickRED.PROGRAM_STDIO_REDIRECTION_DEV_NULL = 0
  • BrickRED.PROGRAM_STDIO_REDIRECTION_PIPE = 1
  • BrickRED.PROGRAM_STDIO_REDIRECTION_FILE = 2
  • BrickRED.PROGRAM_STDIO_REDIRECTION_INDIVIDUAL_LOG = 3
  • BrickRED.PROGRAM_STDIO_REDIRECTION_CONTINUOUS_LOG = 4
  • BrickRED.PROGRAM_STDIO_REDIRECTION_STDOUT = 5
  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.ProgramStdioRedirection getProgramStdioRedirection(int programId, int sessionId)

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
  • BrickRED.PROGRAM_STDIO_REDIRECTION_DEV_NULL = 0
  • BrickRED.PROGRAM_STDIO_REDIRECTION_PIPE = 1
  • BrickRED.PROGRAM_STDIO_REDIRECTION_FILE = 2
  • BrickRED.PROGRAM_STDIO_REDIRECTION_INDIVIDUAL_LOG = 3
  • BrickRED.PROGRAM_STDIO_REDIRECTION_CONTINUOUS_LOG = 4
  • BrickRED.PROGRAM_STDIO_REDIRECTION_STDOUT = 5

The returned object has the public member variables short errorCode, short stdinRedirection, int stdinFileNameStringId, short stdoutRedirection, int stdoutFileNameStringId, short stderrRedirection and int stderrFileNameStringId.

public short setProgramSchedule(int programId, short startMode, boolean continueAfterError, long startInterval, int startFieldsStringId)

The following constants are available for this function:

  • BrickRED.PROGRAM_START_MODE_NEVER = 0
  • BrickRED.PROGRAM_START_MODE_ALWAYS = 1
  • BrickRED.PROGRAM_START_MODE_INTERVAL = 2
  • BrickRED.PROGRAM_START_MODE_CRON = 3
  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.ProgramSchedule getProgramSchedule(int programId, int sessionId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
  • BrickRED.PROGRAM_START_MODE_NEVER = 0
  • BrickRED.PROGRAM_START_MODE_ALWAYS = 1
  • BrickRED.PROGRAM_START_MODE_INTERVAL = 2
  • BrickRED.PROGRAM_START_MODE_CRON = 3

The returned object has the public member variables short errorCode, short startMode, boolean continueAfterError, long startInterval and int startFieldsStringId.

public BrickRED.ProgramSchedulerState getProgramSchedulerState(int programId, int sessionId)

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

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
  • BrickRED.PROGRAM_SCHEDULER_STATE_STOPPED = 0
  • BrickRED.PROGRAM_SCHEDULER_STATE_RUNNING = 1

The returned object has the public member variables short errorCode, short state, long timestamp and int messageStringId.

public short continueProgramSchedule(int programId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public short startProgram(int programId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.LastSpawnedProgramProcess getLastSpawnedProgramProcess(int programId, int sessionId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode, int processId and long timestamp.

public BrickRED.CustomProgramOptionNames getCustomProgramOptionNames(int programId, int sessionId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int namesListId.

public short setCustomProgramOptionValue(int programId, int nameStringId, int valueStringId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public BrickRED.CustomProgramOptionValue getCustomProgramOptionValue(int programId, int nameStringId, int sessionId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144

The returned object has the public member variables short errorCode and int valueStringId.

public short removeCustomProgramOption(int programId, int nameStringId)

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public short[] getAPIVersion()

Returns the version of the API definition (major, minor, revision) implemented by this API bindings. This is neither the release version of this API bindings nor does it tell you anything about the represented Brick or Bricklet.

public boolean getResponseExpected(short functionId)

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

For getter functions this is enabled by default and cannot be disabled, because those functions will always send a response. For listener configuration functions it is enabled by default too, but can be disabled by setResponseExpected(). For setter functions it is disabled by default and can be enabled.

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

See setResponseExpected() for the list of function ID constants available for this function.

public void setResponseExpected(short functionId, boolean responseExpected)

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

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

The following function ID constants are available for this function:

  • BrickRED.FUNCTION_EXPIRE_SESSION_UNCHECKED = 3
  • BrickRED.FUNCTION_RELEASE_OBJECT_UNCHECKED = 6
  • BrickRED.FUNCTION_READ_FILE_ASYNC = 21
  • BrickRED.FUNCTION_WRITE_FILE_UNCHECKED = 24
  • BrickRED.FUNCTION_WRITE_FILE_ASYNC = 25
public void setResponseExpectedAll(boolean responseExpected)

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

public BrickRED.Identity getIdentity()

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. There is also a constant for the device identifier of this Brick.

The returned object has the public member variables String uid, String connectedUid, char position, short[] hardwareVersion, short[] firmwareVersion and int deviceIdentifier.

Listeners

Listeners can be registered to receive time critical or recurring data from the device. The registration is done with "add*Listener" functions of the device object.

The parameter is a listener class object, for example:

device.addExampleListener(new BrickRED.ExampleListener() {
    public void property(int value) {
        System.out.println("Value: " + value);
    }
});

The available listener classes with inherent methods to be overwritten are described below. It is possible to add several listeners and to remove them with the corresponding "remove*Listener" function.

Note

Using listeners 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.

public class BrickRED.AsyncFileReadListener()

This listener can be added with the addAsyncFileReadListener() function. An added listener can be removed with the removeAsyncFileReadListener() function.

public void asyncFileRead(int fileId, short errorCode, short[] buffer, short lengthRead)

This listener reports the result of a call to the readFileAsync() function.

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public class BrickRED.AsyncFileWriteListener()

This listener can be added with the addAsyncFileWriteListener() function. An added listener can be removed with the removeAsyncFileWriteListener() function.

public void asyncFileWrite(int fileId, short errorCode, short lengthWritten)

This listener reports the result of a call to the writeFileAsync() function.

The following constants are available for this function:

  • BrickRED.ERROR_CODE_SUCCESS = 0
  • BrickRED.ERROR_CODE_UNKNOWN_ERROR = 1
  • BrickRED.ERROR_CODE_INVALID_OPERATION = 2
  • BrickRED.ERROR_CODE_OPERATION_ABORTED = 3
  • BrickRED.ERROR_CODE_INTERNAL_ERROR = 4
  • BrickRED.ERROR_CODE_UNKNOWN_SESSION_ID = 5
  • BrickRED.ERROR_CODE_NO_FREE_SESSION_ID = 6
  • BrickRED.ERROR_CODE_UNKNOWN_OBJECT_ID = 7
  • BrickRED.ERROR_CODE_NO_FREE_OBJECT_ID = 8
  • BrickRED.ERROR_CODE_OBJECT_IS_LOCKED = 9
  • BrickRED.ERROR_CODE_NO_MORE_DATA = 10
  • BrickRED.ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11
  • BrickRED.ERROR_CODE_PROGRAM_IS_PURGED = 12
  • BrickRED.ERROR_CODE_INVALID_PARAMETER = 128
  • BrickRED.ERROR_CODE_NO_FREE_MEMORY = 129
  • BrickRED.ERROR_CODE_NO_FREE_SPACE = 130
  • BrickRED.ERROR_CODE_ACCESS_DENIED = 121
  • BrickRED.ERROR_CODE_ALREADY_EXISTS = 132
  • BrickRED.ERROR_CODE_DOES_NOT_EXIST = 133
  • BrickRED.ERROR_CODE_INTERRUPTED = 134
  • BrickRED.ERROR_CODE_IS_DIRECTORY = 135
  • BrickRED.ERROR_CODE_NOT_A_DIRECTORY = 136
  • BrickRED.ERROR_CODE_WOULD_BLOCK = 137
  • BrickRED.ERROR_CODE_OVERFLOW = 138
  • BrickRED.ERROR_CODE_BAD_FILE_DESCRIPTOR = 139
  • BrickRED.ERROR_CODE_OUT_OF_RANGE = 140
  • BrickRED.ERROR_CODE_NAME_TOO_LONG = 141
  • BrickRED.ERROR_CODE_INVALID_SEEK = 142
  • BrickRED.ERROR_CODE_NOT_SUPPORTED = 143
  • BrickRED.ERROR_CODE_TOO_MANY_OPEN_FILES = 144
public class BrickRED.FileEventsOccurredListener()

This listener can be added with the addFileEventsOccurredListener() function. An added listener can be removed with the removeFileEventsOccurredListener() function.

public void fileEventsOccurred(int fileId, int events)

The following constants are available for this function:

  • BrickRED.FILE_EVENT_READABLE = 1
  • BrickRED.FILE_EVENT_WRITABLE = 2
public class BrickRED.ProcessStateChangedListener()

This listener can be added with the addProcessStateChangedListener() function. An added listener can be removed with the removeProcessStateChangedListener() function.

public void processStateChanged(int processId, short state, long timestamp, short exitCode)

The following constants are available for this function:

  • BrickRED.PROCESS_STATE_UNKNOWN = 0
  • BrickRED.PROCESS_STATE_RUNNING = 1
  • BrickRED.PROCESS_STATE_ERROR = 2
  • BrickRED.PROCESS_STATE_EXITED = 3
  • BrickRED.PROCESS_STATE_KILLED = 4
  • BrickRED.PROCESS_STATE_STOPPED = 5
public class BrickRED.ProgramSchedulerStateChangedListener()

This listener can be added with the addProgramSchedulerStateChangedListener() function. An added listener can be removed with the removeProgramSchedulerStateChangedListener() function.

public void programSchedulerStateChanged(int programId)
public class BrickRED.ProgramProcessSpawnedListener()

This listener can be added with the addProgramProcessSpawnedListener() function. An added listener can be removed with the removeProgramProcessSpawnedListener() function.

public void programProcessSpawned(int programId)

Constants

public static final int BrickRED.DEVICE_IDENTIFIER

This constant is used to identify a RED Brick.

The getIdentity() function and the EnumerateListener listener of the IP Connection have a deviceIdentifier parameter to specify the Brick's or Bricklet's type.

public static final String BrickRED.DEVICE_DISPLAY_NAME

This constant represents the human readable name of a RED Brick.