Fix method getVbattery as it incorrectly expected the channelID rather than DeviceID

This commit is contained in:
Dale Schultz 2013-03-23 16:12:16 -04:00
parent 5b82a3ad26
commit e4903b2b4a
2 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ public interface J2534 {
byte[] fastInit(int channelId, byte[] input);
double getVbattery(int channelId);
double getVbattery(int deviceId);
void writeMsg(int channelId, byte[] data, long timeout, TxFlags flag);

View File

@ -786,13 +786,13 @@ public final class J2534Impl implements J2534 {
/**
* This function reads the battery voltage on pin 16 of the J2534 interface.
* @param channelId - handle to the open communications channel
* @param deviceId - handle to the PassThru device
* @return battery voltage in VDC
*/
public double getVbattery(int channelId) {
public double getVbattery(int deviceId) {
NativeLongByReference vBatt = new NativeLongByReference();
NativeLong ret = lib.PassThruIoctl(
new NativeLong(channelId),
new NativeLong(deviceId),
new NativeLong(IOCtl.READ_VBATT.getValue()),
null,
vBatt.getPointer()