mirror of https://github.com/rusefi/RomRaider.git
add j2534 support
git-svn-id: https://svn2.assembla.com/svn/romraider/trunk@144 38686702-15cf-42e4-a595-3071df8bf5ea
This commit is contained in:
parent
81d593bef8
commit
74e2aea1bd
|
@ -17,7 +17,6 @@ public interface J2534 {
|
|||
|
||||
void writeMsg(int channelId, byte[] data);
|
||||
|
||||
// FIX - Needs to return msg type, etc. Create Response object.
|
||||
byte[] readMsg(int channelId);
|
||||
|
||||
void stopMsgFilter(int channelId, int msgId);
|
||||
|
|
|
@ -6,6 +6,7 @@ import static com.romraider.io.j2534.op20.OpenPort20.CONFIG_P3_MIN;
|
|||
import static com.romraider.io.j2534.op20.OpenPort20.CONFIG_P4_MIN;
|
||||
import static com.romraider.io.j2534.op20.OpenPort20.FLAG_NONE;
|
||||
import static com.romraider.io.j2534.op20.OpenPort20.PROTOCOL_ISO9141;
|
||||
import com.romraider.util.HexUtil;
|
||||
|
||||
public final class TestJ2534 {
|
||||
private static final J2534 api = new J2534OpenPort20(PROTOCOL_ISO9141);
|
||||
|
@ -26,7 +27,12 @@ public final class TestJ2534 {
|
|||
try {
|
||||
|
||||
byte[] ecuInit = {(byte) 0x80, (byte) 0x10, (byte) 0xF0, (byte) 0x01, (byte) 0xBF};
|
||||
|
||||
api.writeMsg(channelId, ecuInit);
|
||||
byte[] response = api.readMsg(channelId);
|
||||
|
||||
System.out.println("Request = " + HexUtil.asHex(ecuInit));
|
||||
System.out.println("Response = " + HexUtil.asHex(response));
|
||||
|
||||
} finally {
|
||||
api.stopMsgFilter(channelId, msgId);
|
||||
|
|
|
@ -88,6 +88,7 @@ public final class J2534OpenPort20 implements J2534 {
|
|||
if (status != STATUS_NOERROR) handleError(status);
|
||||
}
|
||||
|
||||
// FIX - Needs to check msg type and retry until msg received
|
||||
public byte[] readMsg(int channelId) {
|
||||
PassThruMessage msg = passThruMessage();
|
||||
int[] pNumMsgs = {1};
|
||||
|
|
Loading…
Reference in New Issue