Python - RED Brick

Dies ist die Beschreibung der Python API Bindings für den RED Brick. Allgemeine Informationen über die Funktionen und technischen Spezifikationen des RED Brick sind in dessen Hardware Beschreibung zusammengefasst.

Eine Installationanleitung für die Python API Bindings ist Teil deren allgemeine Beschreibung.

Beispiele

Der folgende Beispielcode ist Public Domain (CC0 1.0).

Start Program

Download (example_start_program.py)

 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-

HOST = 'localhost'
PORT = 4223
UID = '3dfEZD' # Change to your UID
PROGRAM = 'test' # Change to your program identifier

from tinkerforge.ip_connection import IPConnection
from tinkerforge.brick_red import RED

def check_error(error_code, *args):
    if error_code != 0:
        print('RED Brick error occurred: {0}'.format(error_code))
        exit(1)

    if len(args) == 1:
        return args[0]

    return args

def start_program(red, identifier):
    # Create session and get program list
    session_id = check_error(*red.create_session(10))
    program_list_id = check_error(*red.get_programs(session_id))

    # Iterate program list to find the one to start
    started = False

    for i in range(check_error(*red.get_list_length(program_list_id))):
        program_id, _ = check_error(*red.get_list_item(program_list_id, i, session_id))

        # Get program identifier string
        string_id = check_error(*red.get_program_identifier(program_id, session_id))
        string_length = check_error(*red.get_string_length(string_id))
        string_data = ''

        while len(string_data) < string_length:
            string_data += check_error(*red.get_string_chunk(string_id, len(string_data)))

        check_error(red.release_object(string_id, session_id))

        # Check if this is the program to be started
        if string_data.decode('utf-8') == identifier:
            check_error(red.start_program(program_id))
            started = True

        check_error(red.release_object(program_id, session_id))

        if started:
            break

    check_error(red.release_object(program_list_id, session_id))
    check_error(red.expire_session(session_id))

    return started

if __name__ == '__main__':
    ipcon = IPConnection() # Create IP connection
    red = RED(UID, ipcon) # Create device object

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

    if start_program(red, PROGRAM):
        print('Started RED Brick program: {0}'.format(PROGRAM))
    else:
        print('RED Brick program not found: {0}'.format(PROGRAM))

    raw_input('Press key to exit\n') # Use input() in Python 3
    ipcon.disconnect()

API

Prinzipiell kann jede Funktion der Python Bindings tinkerforge.ip_connection.Error Exception werfen, welche ein value und eine description Property hat. value kann verschiende Werte haben:

  • Error.TIMEOUT = -1
  • Error.ALREADY_CONNECTED = -7
  • Error.NOT_CONNECTED = -8
  • Error.INVALID_PARAMETER = -9
  • Error.NOT_SUPPORTED = -10
  • Error.UNKNOWN_ERROR_CODE = -11
  • Error.STREAM_OUT_OF_SYNC = -12

Alle folgend aufgelisteten Funktionen sind Thread-sicher.

Bemerkung

Die API Dokumentation für den RED Brick ist noch nicht vollständig.

Fortgeschrittene Funktionen

BrickRED.create_session(lifetime)
Parameter:lifetime -- int
Rückgabetyp:(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und session_id.

BrickRED.expire_session(session_id)
Parameter:session_id -- int
Rückgabetyp:int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.expire_session_unchecked(session_id)
Parameter:session_id -- int
Rückgabetyp:None
BrickRED.keep_session_alive(session_id, lifetime)
Parameter:
  • session_id -- int
  • lifetime -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.release_object(object_id, session_id)
Parameter:
  • object_id -- int
  • session_id -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.release_object_unchecked(object_id, session_id)
Parameter:
  • object_id -- int
  • session_id -- int
Rückgabetyp:

None

BrickRED.allocate_string(length_to_reserve, buffer, session_id)
Parameter:
  • length_to_reserve -- int
  • buffer -- str
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und string_id.

BrickRED.truncate_string(string_id, length)
Parameter:
  • string_id -- int
  • length -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.get_string_length(string_id)
Parameter:string_id -- int
Rückgabetyp:(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und length.

BrickRED.set_string_chunk(string_id, offset, buffer)
Parameter:
  • string_id -- int
  • offset -- int
  • buffer -- str
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.get_string_chunk(string_id, offset)
Parameter:
  • string_id -- int
  • offset -- int
Rückgabetyp:

(int, str)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und buffer.

BrickRED.allocate_list(length_to_reserve, session_id)
Parameter:
  • length_to_reserve -- int
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und list_id.

BrickRED.get_list_length(list_id)
Parameter:list_id -- int
Rückgabetyp:(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und length.

BrickRED.get_list_item(list_id, index, session_id)
Parameter:
  • list_id -- int
  • index -- int
  • session_id -- int
Rückgabetyp:

(int, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, item_object_id und type.

BrickRED.append_to_list(list_id, item_object_id)
Parameter:
  • list_id -- int
  • item_object_id -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.remove_from_list(list_id, index)
Parameter:
  • list_id -- int
  • index -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.open_file(name_string_id, flags, permissions, uid, gid, session_id)
Parameter:
  • name_string_id -- int
  • flags -- int
  • permissions -- int
  • uid -- int
  • gid -- int
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und file_id.

BrickRED.create_pipe(flags, length, session_id)
Parameter:
  • flags -- int
  • length -- int
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und file_id.

BrickRED.get_file_info(file_id, session_id)
Parameter:
  • file_id -- int
  • session_id -- int
Rückgabetyp:

(int, int, int, int, int, int, int, int, int, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, type, name_string_id, flags, permissions, uid, gid, length, access_timestamp, modification_timestamp und status_change_timestamp.

BrickRED.read_file(file_id, length_to_read)
Parameter:
  • file_id -- int
  • length_to_read -- int
Rückgabetyp:

(int, [int, int, ..59x.., int], int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, buffer und length_read.

BrickRED.read_file_async(file_id, length_to_read)
Parameter:
  • file_id -- int
  • length_to_read -- int
Rückgabetyp:

None

BrickRED.abort_async_file_read(file_id)
Parameter:file_id -- int
Rückgabetyp:int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.write_file(file_id, buffer, length_to_write)
Parameter:
  • file_id -- int
  • buffer -- [int, int, ..58x.., int]
  • length_to_write -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und length_written.

BrickRED.write_file_unchecked(file_id, buffer, length_to_write)
Parameter:
  • file_id -- int
  • buffer -- [int, int, ..58x.., int]
  • length_to_write -- int
Rückgabetyp:

None

BrickRED.write_file_async(file_id, buffer, length_to_write)
Parameter:
  • file_id -- int
  • buffer -- [int, int, ..58x.., int]
  • length_to_write -- int
Rückgabetyp:

None

BrickRED.set_file_position(file_id, offset, origin)
Parameter:
  • file_id -- int
  • offset -- int
  • origin -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und position.

BrickRED.get_file_position(file_id)
Parameter:file_id -- int
Rückgabetyp:(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und position.

BrickRED.set_file_events(file_id, events)
Parameter:
  • file_id -- int
  • events -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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
BrickRED.get_file_events(file_id)
Parameter:file_id -- int
Rückgabetyp:(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und events.

BrickRED.open_directory(name_string_id, session_id)
Parameter:
  • name_string_id -- int
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und directory_id.

BrickRED.get_directory_name(directory_id, session_id)
Parameter:
  • directory_id -- int
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und name_string_id.

BrickRED.get_next_directory_entry(directory_id, session_id)
Parameter:
  • directory_id -- int
  • session_id -- int
Rückgabetyp:

(int, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, name_string_id und type.

BrickRED.rewind_directory(directory_id)
Parameter:directory_id -- int
Rückgabetyp:int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.create_directory(name_string_id, flags, permissions, uid, gid)
Parameter:
  • name_string_id -- int
  • flags -- int
  • permissions -- int
  • uid -- int
  • gid -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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
BrickRED.get_processes(session_id)
Parameter:session_id -- int
Rückgabetyp:(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und processes_list_id.

BrickRED.spawn_process(executable_string_id, arguments_list_id, environment_list_id, working_directory_string_id, uid, gid, stdin_file_id, stdout_file_id, stderr_file_id, session_id)
Parameter:
  • executable_string_id -- int
  • arguments_list_id -- int
  • environment_list_id -- int
  • working_directory_string_id -- int
  • uid -- int
  • gid -- int
  • stdin_file_id -- int
  • stdout_file_id -- int
  • stderr_file_id -- int
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und process_id.

BrickRED.kill_process(process_id, signal)
Parameter:
  • process_id -- int
  • signal -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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
BrickRED.get_process_command(process_id, session_id)
Parameter:
  • process_id -- int
  • session_id -- int
Rückgabetyp:

(int, int, int, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, executable_string_id, arguments_list_id, environment_list_id und working_directory_string_id.

BrickRED.get_process_identity(process_id)
Parameter:process_id -- int
Rückgabetyp:(int, int, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, pid, uid und gid.

BrickRED.get_process_stdio(process_id, session_id)
Parameter:
  • process_id -- int
  • session_id -- int
Rückgabetyp:

(int, int, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, stdin_file_id, stdout_file_id und stderr_file_id.

BrickRED.get_process_state(process_id)
Parameter:process_id -- int
Rückgabetyp:(int, int, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, state, timestamp und exit_code.

BrickRED.get_programs(session_id)
Parameter:session_id -- int
Rückgabetyp:(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und programs_list_id.

BrickRED.define_program(identifier_string_id, session_id)
Parameter:
  • identifier_string_id -- int
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und program_id.

BrickRED.purge_program(program_id, cookie)
Parameter:
  • program_id -- int
  • cookie -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.get_program_identifier(program_id, session_id)
Parameter:
  • program_id -- int
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und identifier_string_id.

BrickRED.get_program_root_directory(program_id, session_id)
Parameter:
  • program_id -- int
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und root_directory_string_id.

BrickRED.set_program_command(program_id, executable_string_id, arguments_list_id, environment_list_id, working_directory_string_id)
Parameter:
  • program_id -- int
  • executable_string_id -- int
  • arguments_list_id -- int
  • environment_list_id -- int
  • working_directory_string_id -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.get_program_command(program_id, session_id)
Parameter:
  • program_id -- int
  • session_id -- int
Rückgabetyp:

(int, int, int, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, executable_string_id, arguments_list_id, environment_list_id und working_directory_string_id.

BrickRED.set_program_stdio_redirection(program_id, stdin_redirection, stdin_file_name_string_id, stdout_redirection, stdout_file_name_string_id, stderr_redirection, stderr_file_name_string_id)
Parameter:
  • program_id -- int
  • stdin_redirection -- int
  • stdin_file_name_string_id -- int
  • stdout_redirection -- int
  • stdout_file_name_string_id -- int
  • stderr_redirection -- int
  • stderr_file_name_string_id -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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
BrickRED.get_program_stdio_redirection(program_id, session_id)
Parameter:
  • program_id -- int
  • session_id -- int
Rückgabetyp:

(int, int, int, int, int, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, stdin_redirection, stdin_file_name_string_id, stdout_redirection, stdout_file_name_string_id, stderr_redirection und stderr_file_name_string_id.

BrickRED.set_program_schedule(program_id, start_mode, continue_after_error, start_interval, start_fields_string_id)
Parameter:
  • program_id -- int
  • start_mode -- int
  • continue_after_error -- bool
  • start_interval -- int
  • start_fields_string_id -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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
BrickRED.get_program_schedule(program_id, session_id)
Parameter:
  • program_id -- int
  • session_id -- int
Rückgabetyp:

(int, int, bool, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, start_mode, continue_after_error, start_interval und start_fields_string_id.

BrickRED.get_program_scheduler_state(program_id, session_id)
Parameter:
  • program_id -- int
  • session_id -- int
Rückgabetyp:

(int, int, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, state, timestamp und message_string_id.

BrickRED.continue_program_schedule(program_id)
Parameter:program_id -- int
Rückgabetyp:int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.start_program(program_id)
Parameter:program_id -- int
Rückgabetyp:int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.get_last_spawned_program_process(program_id, session_id)
Parameter:
  • program_id -- int
  • session_id -- int
Rückgabetyp:

(int, int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code, process_id und timestamp.

BrickRED.get_custom_program_option_names(program_id, session_id)
Parameter:
  • program_id -- int
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und names_list_id.

BrickRED.set_custom_program_option_value(program_id, name_string_id, value_string_id)
Parameter:
  • program_id -- int
  • name_string_id -- int
  • value_string_id -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.get_custom_program_option_value(program_id, name_string_id, session_id)
Parameter:
  • program_id -- int
  • name_string_id -- int
  • session_id -- int
Rückgabetyp:

(int, int)

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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

Das zurückgegebene namedtuple enthält die Variablen error_code und value_string_id.

BrickRED.remove_custom_program_option(program_id, name_string_id)
Parameter:
  • program_id -- int
  • name_string_id -- int
Rückgabetyp:

int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.get_api_version()
Rückgabetyp:[int, int, int]

Gibt die Version der API Definition (Major, Minor, Revision) zurück, die diese API Bindings implementieren. Dies ist weder die Release-Version dieser API Bindings noch gibt es in irgendeiner Weise Auskunft über den oder das repräsentierte(n) Brick oder Bricklet.

BrickRED.get_response_expected(function_id)
Parameter:function_id -- int
Rückgabetyp:bool

Gibt das Response-Expected-Flag für die Funktion mit der angegebenen Funktions IDs zurück. Es ist true falls für die Funktion beim Aufruf eine Antwort erwartet wird, false andernfalls.

Für Getter-Funktionen ist diese Flag immer gesetzt und kann nicht entfernt werden, da diese Funktionen immer eine Antwort senden. Für Konfigurationsfunktionen für Callbacks ist es standardmäßig gesetzt, kann aber entfernt werden mittels set_response_expected(). Für Setter-Funktionen ist es standardmäßig nicht gesetzt, kann aber gesetzt werden.

Wenn das Response-Expected-Flag für eine Setter-Funktion gesetzt ist, können Timeouts und andere Fehlerfälle auch für Aufrufe dieser Setter-Funktion detektiert werden. Das Gerät sendet dann eine Antwort extra für diesen Zweck. Wenn das Flag für eine Setter-Funktion nicht gesetzt ist, dann wird keine Antwort vom Gerät gesendet und Fehler werden stillschweigend ignoriert, da sie nicht detektiert werden können.

Siehe set_response_expected() für die Liste der verfügbaren Funktions ID Konstanten für diese Funktion.

BrickRED.set_response_expected(function_id, response_expected)
Parameter:
  • function_id -- int
  • response_expected -- bool
Rückgabetyp:

None

Ändert das Response-Expected-Flag für die Funktion mit der angegebenen Funktion IDs. Diese Flag kann nur für Setter-Funktionen (Standardwert: false) und Konfigurationsfunktionen für Callbacks (Standardwert: true) geändert werden. Für Getter-Funktionen ist das Flag immer gesetzt.

Wenn das Response-Expected-Flag für eine Setter-Funktion gesetzt ist, können Timeouts und andere Fehlerfälle auch für Aufrufe dieser Setter-Funktion detektiert werden. Das Gerät sendet dann eine Antwort extra für diesen Zweck. Wenn das Flag für eine Setter-Funktion nicht gesetzt ist, dann wird keine Antwort vom Gerät gesendet und Fehler werden stillschweigend ignoriert, da sie nicht detektiert werden können.

Die folgenden Funktions ID Konstanten sind für diese Funktion verfügbar:

  • 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
BrickRED.set_response_expected_all(response_expected)
Parameter:response_expected -- bool
Rückgabetyp:None

Ändert das Response-Expected-Flag für alle Setter-Funktionen und Konfigurationsfunktionen für Callbacks diese Gerätes.

BrickRED.get_identity()
Rückgabetyp:(str, str, chr, [int, int, int], [int, int, int], int)

Gibt die UID, die UID zu der der Brick verbunden ist, die Position, die Hard- und Firmware Version sowie den Device Identifier zurück.

Die Position kann '0'-'8' (Stack Position) sein.

Eine Liste der Device Identifier Werte ist hier zu finden. Es gibt auch eine Konstante für den Device Identifier dieses Bricks.

Das zurückgegebene namedtuple enthält die Variablen uid, connected_uid, position, hardware_version, firmware_version und device_identifier.

Konfigurationsfunktionen für Callbacks

BrickRED.register_callback(callback_id, function)
Parameter:
  • callback_id -- int
  • function -- callable
Rückgabetyp:

None

Registriert die function für die gegebene callback_id.

Die verfügbaren Callback IDs mit den zugehörigen Funktionssignaturen sind unten zu finden.

Callbacks

Callbacks können registriert werden um zeitkritische oder wiederkehrende Daten vom Gerät zu erhalten. Die Registrierung kann mit der Funktion register_callback() des Geräte Objektes durchgeführt werden. Der erste Parameter ist die Callback ID und der zweite Parameter die Callback-Funktion:

def my_callback(param):
    print(param)

red.register_callback(BrickRED.CALLBACK_EXAMPLE, my_callback)

Die verfügbaren IDs mit der dazugehörigen Parameteranzahl und -typen werden weiter unten beschrieben.

Bemerkung

Callbacks für wiederkehrende Ereignisse zu verwenden ist immer zu bevorzugen gegenüber der Verwendung von Abfragen. Es wird weniger USB-Bandbreite benutzt und die Latenz ist erheblich geringer, da es keine Paketumlaufzeit gibt.

BrickRED.CALLBACK_ASYNC_FILE_READ
Parameter:
  • file_id -- int
  • error_code -- int
  • buffer -- [int, int, ..57x.., int]
  • length_read -- int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.CALLBACK_ASYNC_FILE_WRITE
Parameter:
  • file_id -- int
  • error_code -- int
  • length_written -- int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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.CALLBACK_FILE_EVENTS_OCCURRED
Parameter:
  • file_id -- int
  • events -- int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • BrickRED.FILE_EVENT_READABLE = 1
  • BrickRED.FILE_EVENT_WRITABLE = 2
BrickRED.CALLBACK_PROCESS_STATE_CHANGED
Parameter:
  • process_id -- int
  • state -- int
  • timestamp -- int
  • exit_code -- int

Die folgenden Konstanten sind für diese Funktion verfügbar:

  • 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
BrickRED.CALLBACK_PROGRAM_SCHEDULER_STATE_CHANGED
Parameter:program_id -- int
BrickRED.CALLBACK_PROGRAM_PROCESS_SPAWNED
Parameter:program_id -- int

Konstanten

BrickRED.DEVICE_IDENTIFIER

Diese Konstante wird verwendet um einen RED Brick zu identifizieren.

Die get_identity() Funktion und der CALLBACK_ENUMERATE Callback der IP Connection haben ein device_identifier Parameter um den Typ des Bricks oder Bricklets anzugeben.

BrickRED.DEVICE_DISPLAY_NAME

Diese Konstante stellt den Anzeigenamen eines RED Brick dar.