public class BrickRED extends Device
Device.Identity
Constructor and Description |
---|
BrickRED(java.lang.String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
short |
abortAsyncFileRead(int fileId)
Aborts a
readFileAsync(int, long) operation in progress. |
void |
addAsyncFileReadListener(BrickRED.AsyncFileReadListener listener)
Adds a AsyncFileRead listener.
|
void |
addAsyncFileWriteListener(BrickRED.AsyncFileWriteListener listener)
Adds a AsyncFileWrite listener.
|
void |
addFileEventsOccurredListener(BrickRED.FileEventsOccurredListener listener)
Adds a FileEventsOccurred listener.
|
void |
addProcessStateChangedListener(BrickRED.ProcessStateChangedListener listener)
Adds a ProcessStateChanged listener.
|
void |
addProgramProcessSpawnedListener(BrickRED.ProgramProcessSpawnedListener listener)
Adds a ProgramProcessSpawned listener.
|
void |
addProgramSchedulerStateChangedListener(BrickRED.ProgramSchedulerStateChangedListener listener)
Adds a ProgramSchedulerStateChanged listener.
|
BrickRED.AllocateList |
allocateList(int lengthToReserve,
int sessionId)
Allocates a new list object and reserves memory for ``length_to_reserve``
items.
|
BrickRED.AllocateString |
allocateString(long lengthToReserve,
java.lang.String buffer,
int sessionId)
Allocates a new string object, reserves ``length_to_reserve`` bytes memory
for it and sets up to the first 60 bytes.
|
short |
appendToList(int listId,
int itemObjectId)
Appends an object to a list object and increases the reference count of the
appended object by one.
|
short |
continueProgramSchedule(int programId) |
short |
createDirectory(int nameStringId,
long flags,
int permissions,
long uid,
long gid)
FIXME: name has to be absolute
|
BrickRED.CreatePipe |
createPipe(long flags,
long length,
int sessionId)
Creates a new pipe and allocates a new file object for it.
|
BrickRED.CreateSession |
createSession(long lifetime) |
BrickRED.DefineProgram |
defineProgram(int identifierStringId,
int sessionId) |
short |
expireSession(int sessionId) |
void |
expireSessionUnchecked(int sessionId) |
BrickRED.CustomProgramOptionNames |
getCustomProgramOptionNames(int programId,
int sessionId) |
BrickRED.CustomProgramOptionValue |
getCustomProgramOptionValue(int programId,
int nameStringId,
int sessionId) |
BrickRED.DirectoryName |
getDirectoryName(int directoryId,
int sessionId)
Returns the name of a directory object, as passed to
openDirectory(int, int) , and
the resulting error code. |
BrickRED.FileEvents |
getFileEvents(int fileId) |
BrickRED.FileInfo |
getFileInfo(int fileId,
int sessionId)
Returns various information about a file and the resulting error code.
|
BrickRED.FilePosition |
getFilePosition(int fileId)
Returns the current seek position of a file object and returns the
resulting error code.
|
Device.Identity |
getIdentity()
Returns the UID, the UID where the Brick is connected to,
the position, the hardware and firmware version as well as the
device identifier.
|
BrickRED.LastSpawnedProgramProcess |
getLastSpawnedProgramProcess(int programId,
int sessionId) |
BrickRED.ListItem |
getListItem(int listId,
int index,
int sessionId)
Returns the object ID and type of the object stored at ``index`` in a list
object and returns the resulting error code.
|
BrickRED.ListLength |
getListLength(int listId)
Returns the length of a list object in items and the resulting error code.
|
BrickRED.NextDirectoryEntry |
getNextDirectoryEntry(int directoryId,
int sessionId)
Returns the next entry in a directory object and the resulting error code.
|
BrickRED.ProcessCommand |
getProcessCommand(int processId,
int sessionId)
Returns the executable, arguments, environment and working directory used to
spawn a process object, as passed to
spawnProcess(int, int, int, int, long, long, int, int, int, int) , and the resulting
error code. |
BrickRED.Processes |
getProcesses(int sessionId) |
BrickRED.ProcessIdentity |
getProcessIdentity(int processId)
Returns the process ID and the user and group ID used to spawn a process object,
as passed to
spawnProcess(int, int, int, int, long, long, int, int, int, int) , and the resulting error code. |
BrickRED.ProcessState |
getProcessState(int processId)
Returns the current state, timestamp and exit code of a process object, and
the resulting error code.
|
BrickRED.ProcessStdio |
getProcessStdio(int processId,
int sessionId)
Returns the stdin, stdout and stderr files used to spawn a process object, as
passed to
spawnProcess(int, int, int, int, long, long, int, int, int, int) , and the resulting error code. |
BrickRED.ProgramCommand |
getProgramCommand(int programId,
int sessionId)
FIXME: working directory is relative to <home>/programs/<identifier>/bin
|
BrickRED.ProgramIdentifier |
getProgramIdentifier(int programId,
int sessionId) |
BrickRED.ProgramRootDirectory |
getProgramRootDirectory(int programId,
int sessionId)
FIXME: root directory is absolute: <home>/programs/<identifier>
|
BrickRED.Programs |
getPrograms(int sessionId) |
BrickRED.ProgramSchedule |
getProgramSchedule(int programId,
int sessionId) |
BrickRED.ProgramSchedulerState |
getProgramSchedulerState(int programId,
int sessionId)
FIXME: message is currently valid in error-occurred state only
|
BrickRED.ProgramStdioRedirection |
getProgramStdioRedirection(int programId,
int sessionId)
FIXME: stdio file names are relative to <home>/programs/<identifier>/bin
|
BrickRED.StringChunk |
getStringChunk(int stringId,
long offset)
Returns a chunk up to 63 bytes from a string object beginning at ``offset`` and
returns the resulting error code.
|
BrickRED.StringLength |
getStringLength(int stringId)
Returns the length of a string object and the resulting error code.
|
short |
keepSessionAlive(int sessionId,
long lifetime) |
short |
killProcess(int processId,
short signal)
Sends a UNIX signal to a process object and returns the resulting error code.
|
BrickRED.OpenDirectory |
openDirectory(int nameStringId,
int sessionId)
Opens an existing directory and allocates a new directory object for it.
|
BrickRED.OpenFile |
openFile(int nameStringId,
long flags,
int permissions,
long uid,
long gid,
int sessionId)
Opens an existing file or creates a new file and allocates a new file object
for it.
|
short |
purgeProgram(int programId,
long cookie) |
BrickRED.ReadFile |
readFile(int fileId,
short lengthToRead)
Reads up to 62 bytes from a file object.
|
void |
readFileAsync(int fileId,
long lengthToRead)
Reads up to 2\ :sup:`63`\ - 1 bytes from a file object asynchronously.
|
short |
releaseObject(int objectId,
int sessionId)
Decreases the reference count of an object by one and returns the resulting
error code.
|
void |
releaseObjectUnchecked(int objectId,
int sessionId) |
void |
removeAsyncFileReadListener(BrickRED.AsyncFileReadListener listener)
Removes a AsyncFileRead listener.
|
void |
removeAsyncFileWriteListener(BrickRED.AsyncFileWriteListener listener)
Removes a AsyncFileWrite listener.
|
short |
removeCustomProgramOption(int programId,
int nameStringId) |
void |
removeFileEventsOccurredListener(BrickRED.FileEventsOccurredListener listener)
Removes a FileEventsOccurred listener.
|
short |
removeFromList(int listId,
int index)
Removes the object stored at ``index`` from a list object and decreases the
reference count of the removed object by one.
|
void |
removeProcessStateChangedListener(BrickRED.ProcessStateChangedListener listener)
Removes a ProcessStateChanged listener.
|
void |
removeProgramProcessSpawnedListener(BrickRED.ProgramProcessSpawnedListener listener)
Removes a ProgramProcessSpawned listener.
|
void |
removeProgramSchedulerStateChangedListener(BrickRED.ProgramSchedulerStateChangedListener listener)
Removes a ProgramSchedulerStateChanged listener.
|
short |
rewindDirectory(int directoryId)
Rewinds a directory object and returns the resulting error code.
|
short |
setCustomProgramOptionValue(int programId,
int nameStringId,
int valueStringId) |
short |
setFileEvents(int fileId,
int events) |
BrickRED.SetFilePosition |
setFilePosition(int fileId,
long offset,
short origin)
Set the current seek position of a file object relative to ``origin``.
|
short |
setProgramCommand(int programId,
int executableStringId,
int argumentsListId,
int environmentListId,
int workingDirectoryStringId)
FIXME: working directory is relative to <home>/programs/<identifier>/bin
|
short |
setProgramSchedule(int programId,
short startMode,
boolean continueAfterError,
long startInterval,
int startFieldsStringId) |
short |
setProgramStdioRedirection(int programId,
short stdinRedirection,
int stdinFileNameStringId,
short stdoutRedirection,
int stdoutFileNameStringId,
short stderrRedirection,
int stderrFileNameStringId)
FIXME: stdio file names are relative to <home>/programs/<identifier>/bin
|
short |
setStringChunk(int stringId,
long offset,
java.lang.String buffer)
Sets a chunk of up to 58 bytes in a string object beginning at ``offset``.
|
BrickRED.SpawnProcess |
spawnProcess(int executableStringId,
int argumentsListId,
int environmentListId,
int workingDirectoryStringId,
long uid,
long gid,
int stdinFileId,
int stdoutFileId,
int stderrFileId,
int sessionId) |
short |
startProgram(int programId) |
short |
truncateString(int stringId,
long length)
Truncates a string object to ``length`` bytes and returns the resulting
error code.
|
BrickRED.WriteFile |
writeFile(int fileId,
short[] buffer,
short lengthToWrite)
Writes up to 61 bytes to a file object.
|
void |
writeFileAsync(int fileId,
short[] buffer,
short lengthToWrite)
Writes up to 61 bytes to a file object.
|
void |
writeFileUnchecked(int fileId,
short[] buffer,
short lengthToWrite)
Writes up to 61 bytes to a file object.
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final java.lang.String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_CREATE_SESSION
public static final byte FUNCTION_EXPIRE_SESSION
public static final byte FUNCTION_EXPIRE_SESSION_UNCHECKED
public static final byte FUNCTION_KEEP_SESSION_ALIVE
public static final byte FUNCTION_RELEASE_OBJECT
public static final byte FUNCTION_RELEASE_OBJECT_UNCHECKED
public static final byte FUNCTION_ALLOCATE_STRING
public static final byte FUNCTION_TRUNCATE_STRING
public static final byte FUNCTION_GET_STRING_LENGTH
public static final byte FUNCTION_SET_STRING_CHUNK
public static final byte FUNCTION_GET_STRING_CHUNK
public static final byte FUNCTION_ALLOCATE_LIST
public static final byte FUNCTION_GET_LIST_LENGTH
public static final byte FUNCTION_GET_LIST_ITEM
public static final byte FUNCTION_APPEND_TO_LIST
public static final byte FUNCTION_REMOVE_FROM_LIST
public static final byte FUNCTION_OPEN_FILE
public static final byte FUNCTION_CREATE_PIPE
public static final byte FUNCTION_GET_FILE_INFO
public static final byte FUNCTION_READ_FILE
public static final byte FUNCTION_READ_FILE_ASYNC
public static final byte FUNCTION_ABORT_ASYNC_FILE_READ
public static final byte FUNCTION_WRITE_FILE
public static final byte FUNCTION_WRITE_FILE_UNCHECKED
public static final byte FUNCTION_WRITE_FILE_ASYNC
public static final byte FUNCTION_SET_FILE_POSITION
public static final byte FUNCTION_GET_FILE_POSITION
public static final byte FUNCTION_SET_FILE_EVENTS
public static final byte FUNCTION_GET_FILE_EVENTS
public static final byte FUNCTION_OPEN_DIRECTORY
public static final byte FUNCTION_GET_DIRECTORY_NAME
public static final byte FUNCTION_GET_NEXT_DIRECTORY_ENTRY
public static final byte FUNCTION_REWIND_DIRECTORY
public static final byte FUNCTION_CREATE_DIRECTORY
public static final byte FUNCTION_GET_PROCESSES
public static final byte FUNCTION_SPAWN_PROCESS
public static final byte FUNCTION_KILL_PROCESS
public static final byte FUNCTION_GET_PROCESS_COMMAND
public static final byte FUNCTION_GET_PROCESS_IDENTITY
public static final byte FUNCTION_GET_PROCESS_STDIO
public static final byte FUNCTION_GET_PROCESS_STATE
public static final byte FUNCTION_GET_PROGRAMS
public static final byte FUNCTION_DEFINE_PROGRAM
public static final byte FUNCTION_PURGE_PROGRAM
public static final byte FUNCTION_GET_PROGRAM_IDENTIFIER
public static final byte FUNCTION_GET_PROGRAM_ROOT_DIRECTORY
public static final byte FUNCTION_SET_PROGRAM_COMMAND
public static final byte FUNCTION_GET_PROGRAM_COMMAND
public static final byte FUNCTION_SET_PROGRAM_STDIO_REDIRECTION
public static final byte FUNCTION_GET_PROGRAM_STDIO_REDIRECTION
public static final byte FUNCTION_SET_PROGRAM_SCHEDULE
public static final byte FUNCTION_GET_PROGRAM_SCHEDULE
public static final byte FUNCTION_GET_PROGRAM_SCHEDULER_STATE
public static final byte FUNCTION_CONTINUE_PROGRAM_SCHEDULE
public static final byte FUNCTION_START_PROGRAM
public static final byte FUNCTION_GET_LAST_SPAWNED_PROGRAM_PROCESS
public static final byte FUNCTION_GET_CUSTOM_PROGRAM_OPTION_NAMES
public static final byte FUNCTION_SET_CUSTOM_PROGRAM_OPTION_VALUE
public static final byte FUNCTION_GET_CUSTOM_PROGRAM_OPTION_VALUE
public static final byte FUNCTION_REMOVE_CUSTOM_PROGRAM_OPTION
public static final byte FUNCTION_GET_IDENTITY
public static final short ERROR_CODE_SUCCESS
public static final short ERROR_CODE_UNKNOWN_ERROR
public static final short ERROR_CODE_INVALID_OPERATION
public static final short ERROR_CODE_OPERATION_ABORTED
public static final short ERROR_CODE_INTERNAL_ERROR
public static final short ERROR_CODE_UNKNOWN_SESSION_ID
public static final short ERROR_CODE_NO_FREE_SESSION_ID
public static final short ERROR_CODE_UNKNOWN_OBJECT_ID
public static final short ERROR_CODE_NO_FREE_OBJECT_ID
public static final short ERROR_CODE_OBJECT_IS_LOCKED
public static final short ERROR_CODE_NO_MORE_DATA
public static final short ERROR_CODE_WRONG_LIST_ITEM_TYPE
public static final short ERROR_CODE_PROGRAM_IS_PURGED
public static final short ERROR_CODE_INVALID_PARAMETER
public static final short ERROR_CODE_NO_FREE_MEMORY
public static final short ERROR_CODE_NO_FREE_SPACE
public static final short ERROR_CODE_ACCESS_DENIED
public static final short ERROR_CODE_ALREADY_EXISTS
public static final short ERROR_CODE_DOES_NOT_EXIST
public static final short ERROR_CODE_INTERRUPTED
public static final short ERROR_CODE_IS_DIRECTORY
public static final short ERROR_CODE_NOT_A_DIRECTORY
public static final short ERROR_CODE_WOULD_BLOCK
public static final short ERROR_CODE_OVERFLOW
public static final short ERROR_CODE_BAD_FILE_DESCRIPTOR
public static final short ERROR_CODE_OUT_OF_RANGE
public static final short ERROR_CODE_NAME_TOO_LONG
public static final short ERROR_CODE_INVALID_SEEK
public static final short ERROR_CODE_NOT_SUPPORTED
public static final short ERROR_CODE_TOO_MANY_OPEN_FILES
public static final short OBJECT_TYPE_STRING
public static final short OBJECT_TYPE_LIST
public static final short OBJECT_TYPE_FILE
public static final short OBJECT_TYPE_DIRECTORY
public static final short OBJECT_TYPE_PROCESS
public static final short OBJECT_TYPE_PROGRAM
public static final long FILE_FLAG_READ_ONLY
public static final long FILE_FLAG_WRITE_ONLY
public static final long FILE_FLAG_READ_WRITE
public static final long FILE_FLAG_APPEND
public static final long FILE_FLAG_CREATE
public static final long FILE_FLAG_EXCLUSIVE
public static final long FILE_FLAG_NON_BLOCKING
public static final long FILE_FLAG_TRUNCATE
public static final long FILE_FLAG_TEMPORARY
public static final long FILE_FLAG_REPLACE
public static final int FILE_PERMISSION_USER_ALL
public static final int FILE_PERMISSION_USER_READ
public static final int FILE_PERMISSION_USER_WRITE
public static final int FILE_PERMISSION_USER_EXECUTE
public static final int FILE_PERMISSION_GROUP_ALL
public static final int FILE_PERMISSION_GROUP_READ
public static final int FILE_PERMISSION_GROUP_WRITE
public static final int FILE_PERMISSION_GROUP_EXECUTE
public static final int FILE_PERMISSION_OTHERS_ALL
public static final int FILE_PERMISSION_OTHERS_READ
public static final int FILE_PERMISSION_OTHERS_WRITE
public static final int FILE_PERMISSION_OTHERS_EXECUTE
public static final long PIPE_FLAG_NON_BLOCKING_READ
public static final long PIPE_FLAG_NON_BLOCKING_WRITE
public static final short FILE_TYPE_UNKNOWN
public static final short FILE_TYPE_REGULAR
public static final short FILE_TYPE_DIRECTORY
public static final short FILE_TYPE_CHARACTER
public static final short FILE_TYPE_BLOCK
public static final short FILE_TYPE_FIFO
public static final short FILE_TYPE_SYMLINK
public static final short FILE_TYPE_SOCKET
public static final short FILE_TYPE_PIPE
public static final short FILE_ORIGIN_BEGINNING
public static final short FILE_ORIGIN_CURRENT
public static final short FILE_ORIGIN_END
public static final int FILE_EVENT_READABLE
public static final int FILE_EVENT_WRITABLE
public static final short DIRECTORY_ENTRY_TYPE_UNKNOWN
public static final short DIRECTORY_ENTRY_TYPE_REGULAR
public static final short DIRECTORY_ENTRY_TYPE_DIRECTORY
public static final short DIRECTORY_ENTRY_TYPE_CHARACTER
public static final short DIRECTORY_ENTRY_TYPE_BLOCK
public static final short DIRECTORY_ENTRY_TYPE_FIFO
public static final short DIRECTORY_ENTRY_TYPE_SYMLINK
public static final short DIRECTORY_ENTRY_TYPE_SOCKET
public static final long DIRECTORY_FLAG_RECURSIVE
public static final long DIRECTORY_FLAG_EXCLUSIVE
public static final short PROCESS_SIGNAL_INTERRUPT
public static final short PROCESS_SIGNAL_QUIT
public static final short PROCESS_SIGNAL_ABORT
public static final short PROCESS_SIGNAL_KILL
public static final short PROCESS_SIGNAL_USER1
public static final short PROCESS_SIGNAL_USER2
public static final short PROCESS_SIGNAL_TERMINATE
public static final short PROCESS_SIGNAL_CONTINUE
public static final short PROCESS_SIGNAL_STOP
public static final short PROCESS_STATE_UNKNOWN
public static final short PROCESS_STATE_RUNNING
public static final short PROCESS_STATE_ERROR
public static final short PROCESS_STATE_EXITED
public static final short PROCESS_STATE_KILLED
public static final short PROCESS_STATE_STOPPED
public static final short PROGRAM_STDIO_REDIRECTION_DEV_NULL
public static final short PROGRAM_STDIO_REDIRECTION_PIPE
public static final short PROGRAM_STDIO_REDIRECTION_FILE
public static final short PROGRAM_STDIO_REDIRECTION_INDIVIDUAL_LOG
public static final short PROGRAM_STDIO_REDIRECTION_CONTINUOUS_LOG
public static final short PROGRAM_STDIO_REDIRECTION_STDOUT
public static final short PROGRAM_START_MODE_NEVER
public static final short PROGRAM_START_MODE_ALWAYS
public static final short PROGRAM_START_MODE_INTERVAL
public static final short PROGRAM_START_MODE_CRON
public static final short PROGRAM_SCHEDULER_STATE_STOPPED
public static final short PROGRAM_SCHEDULER_STATE_RUNNING
public BrickRED(java.lang.String uid, IPConnection ipcon)
public BrickRED.CreateSession createSession(long lifetime) throws TinkerforgeException
TinkerforgeException
public short expireSession(int sessionId) throws TinkerforgeException
TinkerforgeException
public void expireSessionUnchecked(int sessionId) throws TinkerforgeException
TinkerforgeException
public short keepSessionAlive(int sessionId, long lifetime) throws TinkerforgeException
TinkerforgeException
public short releaseObject(int objectId, int sessionId) throws TinkerforgeException
TinkerforgeException
public void releaseObjectUnchecked(int objectId, int sessionId) throws TinkerforgeException
TinkerforgeException
public BrickRED.AllocateString allocateString(long lengthToReserve, java.lang.String buffer, int sessionId) throws TinkerforgeException
TinkerforgeException
public short truncateString(int stringId, long length) throws TinkerforgeException
TinkerforgeException
public BrickRED.StringLength getStringLength(int stringId) throws TinkerforgeException
TinkerforgeException
public short setStringChunk(int stringId, long offset, java.lang.String buffer) throws TinkerforgeException
TinkerforgeException
public BrickRED.StringChunk getStringChunk(int stringId, long offset) throws TinkerforgeException
TinkerforgeException
public BrickRED.AllocateList allocateList(int lengthToReserve, int sessionId) throws TinkerforgeException
TinkerforgeException
public BrickRED.ListLength getListLength(int listId) throws TinkerforgeException
TinkerforgeException
public BrickRED.ListItem getListItem(int listId, int index, int sessionId) throws TinkerforgeException
TinkerforgeException
public short appendToList(int listId, int itemObjectId) throws TinkerforgeException
TinkerforgeException
public short removeFromList(int listId, int index) throws TinkerforgeException
TinkerforgeException
public BrickRED.OpenFile openFile(int nameStringId, long flags, int permissions, long uid, long gid, int sessionId) throws TinkerforgeException
TinkerforgeException
public BrickRED.CreatePipe createPipe(long flags, long length, int sessionId) throws TinkerforgeException
TinkerforgeException
public BrickRED.FileInfo getFileInfo(int fileId, int sessionId) throws TinkerforgeException
openFile(int, long, int, long, long, int)
.
The returned flags were used to open or create the file object, as passed to
openFile(int, long, int, long, long, int)
or createPipe(long, long, int)
. See the respective function for a list
of possible file and pipe flags.
FIXME: everything except flags and length is invalid if file type is *Pipe*TinkerforgeException
public BrickRED.ReadFile readFile(int fileId, short lengthToRead) throws TinkerforgeException
openFile(int, long, int, long, long, int)
without the *NonBlocking*
flag or by createPipe(long, long, int)
without the *NonBlockingRead* flag then the
error code *NotSupported* is returned.TinkerforgeException
public void readFileAsync(int fileId, long lengthToRead) throws TinkerforgeException
BrickRED.AsyncFileReadListener
listener.
If there is not data to be read, either because the file position reached
end-of-file or because there is not data in the pipe, then zero bytes are
reported.
If the file object was created by openFile(int, long, int, long, long, int)
without the *NonBlocking*
flag or by createPipe(long, long, int)
without the *NonBlockingRead* flag then the error
code *NotSupported* is reported via the BrickRED.AsyncFileReadListener
listener.TinkerforgeException
public short abortAsyncFileRead(int fileId) throws TinkerforgeException
readFileAsync(int, long)
operation in progress.
Returns the resulting error code.
On success the BrickRED.AsyncFileReadListener
listener will report *OperationAborted*.TinkerforgeException
public BrickRED.WriteFile writeFile(int fileId, short[] buffer, short lengthToWrite) throws TinkerforgeException
openFile(int, long, int, long, long, int)
without the *NonBlocking*
flag or by createPipe(long, long, int)
without the *NonBlockingWrite* flag then the
error code *NotSupported* is returned.TinkerforgeException
public void writeFileUnchecked(int fileId, short[] buffer, short lengthToWrite) throws TinkerforgeException
openFile(int, long, int, long, long, int)
without the *NonBlocking*
flag or by createPipe(long, long, int)
without the *NonBlockingWrite* flag then the
write operation will fail silently.TinkerforgeException
public void writeFileAsync(int fileId, short[] buffer, short lengthToWrite) throws TinkerforgeException
BrickRED.AsyncFileWriteListener
listener.
If the file object was created by openFile(int, long, int, long, long, int)
without the *NonBlocking*
flag or by createPipe(long, long, int)
without the *NonBlockingWrite* flag then the
error code *NotSupported* is reported via the BrickRED.AsyncFileWriteListener
listener.TinkerforgeException
public BrickRED.SetFilePosition setFilePosition(int fileId, long offset, short origin) throws TinkerforgeException
createPipe(long, long, int)
then it has no seek
position and the error code *InvalidSeek* is returned.TinkerforgeException
public BrickRED.FilePosition getFilePosition(int fileId) throws TinkerforgeException
createPipe(long, long, int)
then it has no seek
position and the error code *InvalidSeek* is returned.TinkerforgeException
public short setFileEvents(int fileId, int events) throws TinkerforgeException
TinkerforgeException
public BrickRED.FileEvents getFileEvents(int fileId) throws TinkerforgeException
TinkerforgeException
public BrickRED.OpenDirectory openDirectory(int nameStringId, int sessionId) throws TinkerforgeException
TinkerforgeException
public BrickRED.DirectoryName getDirectoryName(int directoryId, int sessionId) throws TinkerforgeException
openDirectory(int, int)
, and
the resulting error code.TinkerforgeException
public BrickRED.NextDirectoryEntry getNextDirectoryEntry(int directoryId, int sessionId) throws TinkerforgeException
rewindDirectory(int)
.
Possible directory entry types are:
* Unknown = 0
* Regular = 1
* Directory = 2
* Character = 3
* Block = 4
* FIFO = 5
* Symlink = 6
* Socket = 7TinkerforgeException
public short rewindDirectory(int directoryId) throws TinkerforgeException
TinkerforgeException
public short createDirectory(int nameStringId, long flags, int permissions, long uid, long gid) throws TinkerforgeException
TinkerforgeException
public BrickRED.Processes getProcesses(int sessionId) throws TinkerforgeException
TinkerforgeException
public BrickRED.SpawnProcess spawnProcess(int executableStringId, int argumentsListId, int environmentListId, int workingDirectoryStringId, long uid, long gid, int stdinFileId, int stdoutFileId, int stderrFileId, int sessionId) throws TinkerforgeException
TinkerforgeException
public short killProcess(int processId, short signal) throws TinkerforgeException
TinkerforgeException
public BrickRED.ProcessCommand getProcessCommand(int processId, int sessionId) throws TinkerforgeException
spawnProcess(int, int, int, int, long, long, int, int, int, int)
, and the resulting
error code.TinkerforgeException
public BrickRED.ProcessIdentity getProcessIdentity(int processId) throws TinkerforgeException
spawnProcess(int, int, int, int, long, long, int, int, int, int)
, and the resulting error code.
The process ID is only valid if the state is *Running* or *Stopped*, see
getProcessState(int)
.TinkerforgeException
public BrickRED.ProcessStdio getProcessStdio(int processId, int sessionId) throws TinkerforgeException
spawnProcess(int, int, int, int, long, long, int, int, int, int)
, and the resulting error code.TinkerforgeException
public BrickRED.ProcessState getProcessState(int processId) throws TinkerforgeException
TinkerforgeException
public BrickRED.Programs getPrograms(int sessionId) throws TinkerforgeException
TinkerforgeException
public BrickRED.DefineProgram defineProgram(int identifierStringId, int sessionId) throws TinkerforgeException
TinkerforgeException
public short purgeProgram(int programId, long cookie) throws TinkerforgeException
TinkerforgeException
public BrickRED.ProgramIdentifier getProgramIdentifier(int programId, int sessionId) throws TinkerforgeException
TinkerforgeException
public BrickRED.ProgramRootDirectory getProgramRootDirectory(int programId, int sessionId) throws TinkerforgeException
TinkerforgeException
public short setProgramCommand(int programId, int executableStringId, int argumentsListId, int environmentListId, int workingDirectoryStringId) throws TinkerforgeException
TinkerforgeException
public BrickRED.ProgramCommand getProgramCommand(int programId, int sessionId) throws TinkerforgeException
TinkerforgeException
public short setProgramStdioRedirection(int programId, short stdinRedirection, int stdinFileNameStringId, short stdoutRedirection, int stdoutFileNameStringId, short stderrRedirection, int stderrFileNameStringId) throws TinkerforgeException
TinkerforgeException
public BrickRED.ProgramStdioRedirection getProgramStdioRedirection(int programId, int sessionId) throws TinkerforgeException
TinkerforgeException
public short setProgramSchedule(int programId, short startMode, boolean continueAfterError, long startInterval, int startFieldsStringId) throws TinkerforgeException
TinkerforgeException
public BrickRED.ProgramSchedule getProgramSchedule(int programId, int sessionId) throws TinkerforgeException
TinkerforgeException
public BrickRED.ProgramSchedulerState getProgramSchedulerState(int programId, int sessionId) throws TinkerforgeException
TinkerforgeException
public short continueProgramSchedule(int programId) throws TinkerforgeException
TinkerforgeException
public short startProgram(int programId) throws TinkerforgeException
TinkerforgeException
public BrickRED.LastSpawnedProgramProcess getLastSpawnedProgramProcess(int programId, int sessionId) throws TinkerforgeException
TinkerforgeException
public BrickRED.CustomProgramOptionNames getCustomProgramOptionNames(int programId, int sessionId) throws TinkerforgeException
TinkerforgeException
public short setCustomProgramOptionValue(int programId, int nameStringId, int valueStringId) throws TinkerforgeException
TinkerforgeException
public BrickRED.CustomProgramOptionValue getCustomProgramOptionValue(int programId, int nameStringId, int sessionId) throws TinkerforgeException
TinkerforgeException
public short removeCustomProgramOption(int programId, int nameStringId) throws TinkerforgeException
TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addAsyncFileReadListener(BrickRED.AsyncFileReadListener listener)
public void removeAsyncFileReadListener(BrickRED.AsyncFileReadListener listener)
public void addAsyncFileWriteListener(BrickRED.AsyncFileWriteListener listener)
public void removeAsyncFileWriteListener(BrickRED.AsyncFileWriteListener listener)
public void addFileEventsOccurredListener(BrickRED.FileEventsOccurredListener listener)
public void removeFileEventsOccurredListener(BrickRED.FileEventsOccurredListener listener)
public void addProcessStateChangedListener(BrickRED.ProcessStateChangedListener listener)
public void removeProcessStateChangedListener(BrickRED.ProcessStateChangedListener listener)
public void addProgramSchedulerStateChangedListener(BrickRED.ProgramSchedulerStateChangedListener listener)
public void removeProgramSchedulerStateChangedListener(BrickRED.ProgramSchedulerStateChangedListener listener)
public void addProgramProcessSpawnedListener(BrickRED.ProgramProcessSpawnedListener listener)
public void removeProgramProcessSpawnedListener(BrickRED.ProgramProcessSpawnedListener listener)
Copyright © 2021 Tinkerforge GmbH. All rights reserved.