de.entropia.can
Class CanSocket
java.lang.Object
de.entropia.can.CanSocket
- All Implemented Interfaces:
- Closeable
public final class CanSocket
- extends Object
- implements Closeable
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CAN_ALL_INTERFACES
public static final CanSocket.CanInterface CAN_ALL_INTERFACES
CAN_MTU
public static final int CAN_MTU
CAN_FD_MTU
public static final int CAN_FD_MTU
CanSocket
public CanSocket(CanSocket.Mode mode)
throws IOException
- Throws:
IOException
loadLibFromJar
public static void loadLibFromJar(String fileName)
throws IOException
- Loads library from current JAR archive
The file from JAR is copied into system temporary directory and then loaded. The temporary file is deleted after exiting.
Method uses String as filename because the pathname is "abstract", not system-dependent.
- Parameters:
filename
- The filename inside JAR as absolute path (beginning with '/'), e.g. /package/File.ext
- Throws:
IOException
- If temporary file creation or read/write operation fails
IllegalArgumentException
- If source file (param path) does not exist
IllegalArgumentException
- If the path is not absolute or if the filename is shorter than three characters (restriction of File.createTempFile(java.lang.String, java.lang.String)
).
bind
public void bind(CanSocket.CanInterface canInterface)
throws IOException
- Throws:
IOException
send
public void send(CanSocket.CanFrame frame)
throws IOException
- Throws:
IOException
recv
public CanSocket.CanFrame recv()
throws IOException
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Throws:
IOException
getMtu
public int getMtu(String canif)
throws IOException
- Throws:
IOException
setLoopbackMode
public void setLoopbackMode(boolean on)
throws IOException
- Throws:
IOException
getLoopbackMode
public boolean getLoopbackMode()
throws IOException
- Throws:
IOException
setRecvOwnMsgsMode
public void setRecvOwnMsgsMode(boolean on)
throws IOException
- Throws:
IOException
getRecvOwnMsgsMode
public boolean getRecvOwnMsgsMode()
throws IOException
- Throws:
IOException
setCanFilter
public void setCanFilter(int can_id,
int can_mask)
throws IOException
- Throws:
IOException
Copyright © 2013. All Rights Reserved.