add j2534 support

git-svn-id: https://svn2.assembla.com/svn/romraider/trunk@141 38686702-15cf-42e4-a595-3071df8bf5ea
This commit is contained in:
kascade 2008-09-20 12:13:59 +00:00
parent 18b51e1b7f
commit 287d554faf
4 changed files with 6 additions and 5 deletions

BIN
lib/logger/jinvoke.jar Normal file

Binary file not shown.

View File

@ -15,9 +15,10 @@ public interface J2534 {
int startPassMsgFilter(int channelId, byte mask, byte pattern);
void writeMsgs(int channelId, byte[] data);
void writeMsg(int channelId, byte[] data);
byte[] readMsgs(int channelId);
// FIX - Needs to return msg type, etc. Create Response object.
byte[] readMsg(int channelId);
void stopMsgFilter(int channelId, int msgId);

View File

@ -24,7 +24,7 @@ public final class TestJ2534 {
try {
byte[] ecuInit = {(byte) 0x80, (byte) 0x10, (byte) 0xF0, (byte) 0x01, (byte) 0xBF};
api.writeMsgs(channelId, ecuInit);
api.writeMsg(channelId, ecuInit);
} finally {
api.stopMsgFilter(channelId, msgId);

View File

@ -78,14 +78,14 @@ public final class J2534OpenPort20 implements J2534 {
return msgId[0];
}
public void writeMsgs(int channelId, byte[] data) {
public void writeMsg(int channelId, byte[] data) {
PassThruMessage msg = passThruMessage(data);
int[] pNumMsgs = {1};
int status = PassThruWriteMsgs(channelId, msg, pNumMsgs, 55);
if (status != STATUS_NOERROR) handleError(status);
}
public byte[] readMsgs(int channelId) {
public byte[] readMsg(int channelId) {
PassThruMessage msg = passThruMessage();
int[] pNumMsgs = {1};
int status = PassThruReadMsgs(channelId, msg, pNumMsgs, 0);