public class NativeDevice extends NativeFile
This class provides access from Java to Linux character devices. It is intended to allow access from Java to the Lego kernel modules which provide access to EV3 hardware features.
fd
Constructor and Description |
---|
NativeDevice(java.lang.String dname)
Create a native device to provide access to the specified character device
|
NativeDevice(java.lang.String dname,
ILibc libc)
Create a native device to provide access to the specified character device
|
NativeDevice(java.lang.String dname,
int flags)
Create a native device to provide access to the specified character device
|
NativeDevice(java.lang.String dname,
int flags,
ILibc libc)
Create a native device to provide access to the specified character device
|
Modifier and Type | Method and Description |
---|---|
Pointer |
mmap(long len)
Map a portion of the device into memory and return a pointer which can be
used to read/write the device.
|
public NativeDevice(java.lang.String dname) throws LastErrorException
dname
- name of the character deviceLastErrorException
public NativeDevice(java.lang.String dname, int flags) throws LastErrorException
flags
- opening flags of the device - read, write or bothdname
- name of the character deviceLastErrorException
public NativeDevice(java.lang.String dname, ILibc libc) throws LastErrorException
dname
- name of the character devicelibc
- standard C library interface to be used.LastErrorException
public NativeDevice(java.lang.String dname, int flags, ILibc libc) throws LastErrorException
flags
- opening flags of the device - read, write or bothdname
- name of the character devicelibc
- standard C library interface to be used.LastErrorException
public Pointer mmap(long len) throws LastErrorException
len
- number of bytes to mapLastErrorException