Quantex GmbH
DE RU EN EL
Your region: Europe

GET_DEVICE_INFO / GET_PROTOCOL_INFO J2534-2

Device information

Last modified:

GET_DEVICE_INFO — Device information

Returns information about the device capabilities: supported protocols, number of simultaneous channels, serial number and other characteristics. Called with the DeviceID returned by PassThruOpen.

IoctlID 0x800C
pInput SCONFIG_LIST* — list of requested parameters
pOutput NULL (the result is written to pInput)
Unlike GET_CONFIG, the GET_DEVICE_INFO function is called with DeviceID, not with ChannelID.

GET_PROTOCOL_INFO — Protocol information

Returns information about the capabilities of a specific protocol: maximum buffer sizes, number of filters, supported parameters. Called with the ChannelID returned by PassThruConnect.

IoctlID 0x800D
pInput SCONFIG_LIST* — list of requested parameters
pOutput NULL (the result is written to pInput)

Data structures

typedef struct {
    unsigned long Parameter;  // Parameter identifier
    unsigned long Value;      // Returned value
} SCONFIG;

typedef struct {
    unsigned long NumOfParams;  // Number of parameters in the list
    SCONFIG *ConfigPtr;         // Pointer to the SCONFIG array
} SCONFIG_LIST;

Returned error codes

Code Description Possible causes and solutions
STATUS_NOERROR Function completed successfully
ERR_DEVICE_NOT_CONNECTED No connection to the adapter
  • Adapter is powered off or out of range
  • Solution: check power supply and connection
ERR_INVALID_DEVICE_ID Invalid device identifier
  • DeviceID was not obtained through PassThruOpen
  • Solution: call PassThruOpen
ERR_INVALID_CHANNEL_ID Invalid channel identifier
  • ChannelID was not obtained through PassThruConnect (for GET_PROTOCOL_INFO)
  • Solution: call PassThruConnect
ERR_NULL_PARAMETER NULL passed instead of a pointer
  • pInput is NULL
  • Solution: pass a pointer to SCONFIG_LIST
ERR_NOT_SUPPORTED Parameter is not supported
  • The requested parameter is not available
  • Solution: check the list of supported parameters
ERR_FAILED Unspecified error
  • Internal error
  • Solution: call PassThruGetLastError()

GET_DEVICE_INFO parameters

Device identification

Parameter Value Description
SERIAL_NUMBER 0x01 Device serial number (string)
PART_NUMBER 0x49 Device part number

Protocol support

Return SUPPORTED (1) or NOT_SUPPORTED (0).

Parameter Value Protocol
J1850PWM_SUPPORTED 0x02 J1850 PWM (Ford)
J1850VPW_SUPPORTED 0x03 J1850 VPW (GM)
ISO9141_SUPPORTED 0x04 ISO 9141-2
ISO14230_SUPPORTED 0x05 ISO 14230 (KWP2000)
CAN_SUPPORTED 0x06 CAN (raw)
ISO15765_SUPPORTED 0x07 ISO 15765 (CAN UDS)
SCI_A_ENGINE_SUPPORTED 0x08 SCI-A Engine (Chrysler)
SCI_A_TRANS_SUPPORTED 0x09 SCI-A Transmission (Chrysler)
SCI_B_ENGINE_SUPPORTED 0x0A SCI-B Engine (Chrysler)
SCI_B_TRANS_SUPPORTED 0x0B SCI-B Transmission (Chrysler)
SW_ISO15765_SUPPORTED 0x0C Single-Wire ISO 15765
SW_CAN_SUPPORTED 0x0D Single-Wire CAN (GM)
GM_UART_SUPPORTED 0x0E GM UART
UART_ECHO_BYTE_SUPPORTED 0x0F UART Echo Byte
HONDA_DIAGH_SUPPORTED 0x10 Honda DIAG-H
J1939_SUPPORTED 0x11 J1939 (heavy-duty)
J1708_SUPPORTED 0x12 J1708 (heavy-duty)
TP2_0_SUPPORTED 0x13 TP 2.0 (VAG)
J2610_SUPPORTED 0x14 J2610 (Chrysler DRB-III)
ANALOG_IN_SUPPORTED 0x15 Analog inputs
FT_CAN_SUPPORTED 0x31 Fault-Tolerant CAN
FT_ISO15765_SUPPORTED 0x32 FT ISO 15765
FD_CAN_SUPPORTED 0x4C CAN FD
FD_ISO15765_SUPPORTED 0x4D ISO 15765 over CAN FD
ETHERNET_NDIS_SUPPORTED 0x54 Ethernet NDIS (DoIP)

Simultaneous channels

Number of channels that can be opened simultaneously for each protocol.

Parameter Value Protocol
J1850PWM_SIMULTANEOUS 0x35 J1850 PWM
J1850VPW_SIMULTANEOUS 0x36 J1850 VPW
ISO9141_SIMULTANEOUS 0x37 ISO 9141
ISO14230_SIMULTANEOUS 0x38 ISO 14230
CAN_SIMULTANEOUS 0x39 CAN
ISO15765_SIMULTANEOUS 0x3A ISO 15765
SW_CAN_SIMULTANEOUS 0x40 SW-CAN
J1939_SIMULTANEOUS 0x44 J1939
TP2_0_SIMULTANEOUS 0x46 TP 2.0
FD_CAN_SIMULTANEOUS 0x4E CAN FD
FD_ISO15765_SIMULTANEOUS 0x4F ISO 15765 FD

J1962 pin assignment

Return the mask of OBD-II pins used by the protocol.

Parameter Value Protocol
CAN_PS_J1962 0x1F CAN (Pin 6, 14)
ISO15765_PS_J1962 0x20 ISO 15765 (Pin 6, 14)
ISO9141_PS_K_LINE_J1962 0x1B ISO 9141 K-Line (Pin 7)
ISO9141_PS_L_LINE_J1962 0x1C ISO 9141 L-Line (Pin 15)
ISO14230_PS_K_LINE_J1962 0x1D ISO 14230 K-Line (Pin 7)
ISO14230_PS_L_LINE_J1962 0x1E ISO 14230 L-Line (Pin 15)
SW_CAN_PS_J1962 0x21 SW-CAN (Pin 1)
J1850PWM_PS_J1962 0x19 J1850 PWM (Pin 2, 10)
J1850VPW_PS_J1962 0x1A J1850 VPW (Pin 2)
FD_CAN_PS_J1962 0x50 CAN FD (Pin 6, 14)
FD_ISO15765_PS_J1962 0x51 ISO 15765 FD (Pin 6, 14)

Additional capabilities

Parameter Value Description
MAX_NON_VOLATILE_STORAGE 0x16 Size of non-volatile storage (bytes)
SHORT_TO_GND_J1962 0x17 Support for short-to-ground detection
PGM_VOLTAGE_J1962 0x18 Support for programming voltage
READ_J1962PIN_VOLTAGE_SUPPORTED 0x52 Support for reading pin voltage
READ_J1962PIN_VOLTAGE_MAX 0x53 Maximum voltage that can be read (mV)

GET_PROTOCOL_INFO parameters

Parameter Value Description
MAX_RX_BUFFER_SIZE 0x01 Maximum receive buffer size (bytes)
MAX_PASS_FILTER 0x02 Maximum number of PASS_FILTER
MAX_BLOCK_FILTER 0x03 Maximum number of BLOCK_FILTER
MAX_FILTER_MSG_LENGTH 0x04 Maximum filter message length (bytes)
MAX_PERIODIC_MSGS 0x05 Maximum number of periodic messages
MAX_PERIODIC_MSG_LENGTH 0x06 Maximum periodic message length (bytes)
DESIRED_DATA_RATE 0x07 Recommended data rate (bit/s)
MAX_FLOW_CONTROL_FILTER 0x12 Maximum number of FLOW_CONTROL_FILTER
MAX_ISO15765_WFT_MAX 0x13 Maximum value of ISO15765_WFT_MAX
NETWORK_LINE_SUPPORTED 0x0A Support for network line selection
MAX_FUNCT_MSG_LOOKUP 0x0B Maximum size of functional address lookup table
PARITY_SUPPORTED 0x0C Support for parity configuration
DATA_BITS_SUPPORTED 0x0D Support for data bits configuration (7/8)
FIVE_BAUD_MOD_SUPPORTED 0x0E Support for 5-baud init modes
L_LINE_SUPPORTED 0x0F Support for L-line
CAN_11_29_IDS_SUPPORTED 0x10 Support for 11-bit and 29-bit CAN IDs
CAN_MIXED_FORMAT_SUPPORTED 0x11 Support for CAN mixed format
TIMESTAMP_RESOLUTION 0x1B Timestamp resolution (µs)
FD_CAN_DATA_PHASE_DATA_RATE_SUPPORTED 0x6C Supported CAN FD data rates

Examples

GET_DEVICE_INFO — querying device capabilities

C/C++ example

#include "j2534_dll.hpp"

unsigned long DeviceID;  // Obtained from PassThruOpen
SCONFIG Config[5];
SCONFIG_LIST ConfigList;
long ret;

// Query protocol support
Config[0].Parameter = CAN_SUPPORTED;
Config[1].Parameter = ISO15765_SUPPORTED;
Config[2].Parameter = ISO14230_SUPPORTED;
Config[3].Parameter = FD_CAN_SUPPORTED;
Config[4].Parameter = TP2_0_SUPPORTED;

ConfigList.NumOfParams = 5;
ConfigList.ConfigPtr = Config;

ret = PassThruIoctl(DeviceID, GET_DEVICE_INFO, &ConfigList, NULL);
if (ret == STATUS_NOERROR)
{
    printf("CAN: %s\n", Config[0].Value ? "supported" : "no");
    printf("ISO 15765: %s\n", Config[1].Value ? "supported" : "no");
    printf("ISO 14230: %s\n", Config[2].Value ? "supported" : "no");
    printf("CAN FD: %s\n", Config[3].Value ? "supported" : "no");
    printf("TP 2.0: %s\n", Config[4].Value ? "supported" : "no");
}

Kotlin (Android) example

// deviceID obtained from ptOpen
val params = listOf(
    PtConfig(parameter = CAN_SUPPORTED, value = 0u),
    PtConfig(parameter = ISO15765_SUPPORTED, value = 0u),
    PtConfig(parameter = FD_CAN_SUPPORTED, value = 0u)
)

val result = j2534.ptIoctl(deviceID, GET_DEVICE_INFO, params.size, params.toByteArray())
if (result.status == STATUS_NOERROR) {
    val resultParams = result.toConfigList()
    Log.i("J2534", "CAN: ${if (resultParams[0].value > 0u) "yes" else "no"}")
    Log.i("J2534", "ISO 15765: ${if (resultParams[1].value > 0u) "yes" else "no"}")
    Log.i("J2534", "CAN FD: ${if (resultParams[2].value > 0u) "yes" else "no"}")
}

Python example

from ctypes import *

config = (SCONFIG * 3)()
config[0].Parameter = CAN_SUPPORTED
config[1].Parameter = ISO15765_SUPPORTED
config[2].Parameter = FD_CAN_SUPPORTED

config_list = SCONFIG_LIST()
config_list.NumOfParams = 3
config_list.ConfigPtr = config

ret = j2534.PassThruIoctl(device_id, GET_DEVICE_INFO, byref(config_list), None)
if ret == 0:
    print(f"CAN: {'yes' if config[0].Value else 'no'}")
    print(f"ISO 15765: {'yes' if config[1].Value else 'no'}")
    print(f"CAN FD: {'yes' if config[2].Value else 'no'}")

C# example

var configs = new SCONFIG[3];
configs[0].Parameter = CAN_SUPPORTED;
configs[1].Parameter = ISO15765_SUPPORTED;
configs[2].Parameter = FD_CAN_SUPPORTED;

var configList = new SCONFIG_LIST {
    NumOfParams = 3,
    ConfigPtr = configs
};

int ret = J2534.PassThruIoctl(deviceId, GET_DEVICE_INFO, ref configList, IntPtr.Zero);
if (ret == 0)
{
    Console.WriteLine($"CAN: {(configs[0].Value > 0 ? "yes" : "no")}");
    Console.WriteLine($"ISO 15765: {(configs[1].Value > 0 ? "yes" : "no")}");
    Console.WriteLine($"CAN FD: {(configs[2].Value > 0 ? "yes" : "no")}");
}

GET_PROTOCOL_INFO — querying protocol information

C/C++ example

#include "j2534_dll.hpp"

unsigned long ChannelID;  // Obtained from PassThruConnect for ISO15765
SCONFIG Config[4];
SCONFIG_LIST ConfigList;
long ret;

// Query protocol limits
Config[0].Parameter = MAX_RX_BUFFER_SIZE;
Config[1].Parameter = MAX_FLOW_CONTROL_FILTER;
Config[2].Parameter = MAX_PERIODIC_MSGS;
Config[3].Parameter = TIMESTAMP_RESOLUTION;

ConfigList.NumOfParams = 4;
ConfigList.ConfigPtr = Config;

ret = PassThruIoctl(ChannelID, GET_PROTOCOL_INFO, &ConfigList, NULL);
if (ret == STATUS_NOERROR)
{
    printf("Max RX buffer size: %lu bytes\n", Config[0].Value);
    printf("Max FLOW_CONTROL filters: %lu\n", Config[1].Value);
    printf("Max periodic messages: %lu\n", Config[2].Value);
    printf("Timestamp resolution: %lu µs\n", Config[3].Value);
}

Kotlin (Android) example

// channelID obtained from ptConnect
val params = listOf(
    PtConfig(parameter = MAX_RX_BUFFER_SIZE, value = 0u),
    PtConfig(parameter = MAX_FLOW_CONTROL_FILTER, value = 0u),
    PtConfig(parameter = MAX_PERIODIC_MSGS, value = 0u)
)

val result = j2534.ptIoctl(channelID, GET_PROTOCOL_INFO, params.size, params.toByteArray())
if (result.status == STATUS_NOERROR) {
    val resultParams = result.toConfigList()
    Log.i("J2534", "Max RX buffer: ${resultParams[0].value} bytes")
    Log.i("J2534", "Max FC filters: ${resultParams[1].value}")
    Log.i("J2534", "Max periodic: ${resultParams[2].value}")
}

Python example

from ctypes import *

config = (SCONFIG * 3)()
config[0].Parameter = MAX_RX_BUFFER_SIZE
config[1].Parameter = MAX_FLOW_CONTROL_FILTER
config[2].Parameter = MAX_PERIODIC_MSGS

config_list = SCONFIG_LIST()
config_list.NumOfParams = 3
config_list.ConfigPtr = config

ret = j2534.PassThruIoctl(channel_id, GET_PROTOCOL_INFO, byref(config_list), None)
if ret == 0:
    print(f"Max RX buffer: {config[0].Value} bytes")
    print(f"Max FC filters: {config[1].Value}")
    print(f"Max periodic: {config[2].Value}")

Full device capability check

C/C++ example

#include "j2534_dll.hpp"
#include <stdio.h>

void PrintDeviceCapabilities(unsigned long DeviceID)
{
    // List of all protocols to check
    struct {
        unsigned long param;
        const char* name;
    } protocols[] = {
        {CAN_SUPPORTED, "CAN"},
        {ISO15765_SUPPORTED, "ISO 15765"},
        {ISO14230_SUPPORTED, "ISO 14230 (KWP2000)"},
        {ISO9141_SUPPORTED, "ISO 9141"},
        {J1850PWM_SUPPORTED, "J1850 PWM"},
        {J1850VPW_SUPPORTED, "J1850 VPW"},
        {FD_CAN_SUPPORTED, "CAN FD"},
        {FD_ISO15765_SUPPORTED, "ISO 15765 FD"},
        {TP2_0_SUPPORTED, "TP 2.0 (VAG)"},
        {J1939_SUPPORTED, "J1939"},
        {SW_CAN_SUPPORTED, "Single-Wire CAN"}
    };

    const int count = sizeof(protocols) / sizeof(protocols[0]);
    SCONFIG* config = new SCONFIG[count];
    SCONFIG_LIST configList;

    for (int i = 0; i < count; i++) {
        config[i].Parameter = protocols[i].param;
        config[i].Value = 0;
    }

    configList.NumOfParams = count;
    configList.ConfigPtr = config;

    long ret = PassThruIoctl(DeviceID, GET_DEVICE_INFO, &configList, NULL);
    if (ret == STATUS_NOERROR) {
        printf("=== Supported protocols ===\n");
        for (int i = 0; i < count; i++) {
            printf("%-20s: %s\n", protocols[i].name,
                   config[i].Value ? "Yes" : "No");
        }
    }

    delete[] config;
}