The function opens a secure connection over the specified protocol. The PassThruSecurityConnect command is used to protect your software and to control access to its functionality.
long PassThruConnect(unsigned long DeviceID, unsigned long ProtocolID, unsigned long Flags, unsigned long BaudRate, unsigned long *pChannelID)
| Definition | Pins | Description |
|---|---|---|
| J1850VPW | 2 VPW | Defined by the SAE J1850 and SAE J2178 standards. Can operate simultaneously with CAN and ISO15765. Not compatible with switched protocols. |
| J1850PWM | 2, 10 PWM | Defined by the SAE J1850 standard. Can operate simultaneously with CAN and ISO15765. Not compatible with switched protocols. |
| ISO9141 | 7K,15L Line | Defined by the ISO 9141 and SAE J1979 standards. Can operate simultaneously with CAN and ISO15765. Not compatible with switched protocols. |
| ISO14230 | 7K,15L Line | |
| CAN | 6H,14L CAN | Raw CAN stream. Can operate simultaneously with all protocols. |
| ISO15765 | 6H,14L CAN | Defined by the ISO 15765-4 and ISO 14229-1 UDS standards. Can operate simultaneously with all protocols. |
| SCI_A_ENGINE | Not supported | |
| SCI_A_TRANS | Not supported | |
| SCI_B_ENGINE | Not supported | |
| SCI_B_TRANS | Not supported | |
| J1850VPW_PS | Switched VPW | Defined by the SAE J1850 and SAE J2178 standards. Can operate simultaneously with CAN and ISO15765. Not compatible with switched protocols. |
| J1850PWM_PS | Switched PWM | Defined by the SAE J1850 standard. Can operate simultaneously with CAN and ISO15765. Not compatible with switched protocols. |
| ISO9141_PS | Switched K L Line | Defined by the ISO 9141 and SAE J1979 standards. Can operate simultaneously with CAN and ISO15765. Not compatible with switched protocols. |
| ISO14230_PS | Switched K L Line | Defined by the ISO 9141 and SAE J1979 standards. Can operate simultaneously with CAN and ISO15765. Not compatible with switched protocols. |
| CAN_PS | Switched CAN | Raw CAN stream. Can operate simultaneously with all protocols. |
| ISO15765_PS | Switched CAN | |
| J2610_PS | Switched | |
| SW_ISO15765_PS | 1 CAN | |
| SW_CAN_PS | 1 CAN | |
| GM_UART_PS | Switched K Linee |
| Definition | Code | Pins | Description |
|---|---|---|---|
| TP1_6_PS | 0x8FFE | 6H,14L CAN | |
| HONDA_DIAGH_PS | 0x800B | Switched K L Line | |
| J1939_PS | 0x800C | 6H,14L CAN | |
| KWP2000_PS | 0x800D | Switched K L Line | |
| TP2_0_PS | 0x800E | 6H,14L CAN | |
| ISO14230_TP2_0_PS | 0x800F | 6H,14L CAN | |
| ISO14230_TP1_6_PS | 0x8010 | ||
| KW1281_PS | 0x8011 | ||
| KW1281_TP1_6_PS | 0x8012 | ||
| ISO5_PS | 0x8013 | Switched K Linee | |
| ISO8_PS | 0x8014 | Switched K Linee | |
| DS2_PS | 0x8015 | Switched K Linee | |
| DAIHATSU_PS | 0x8016 | 7K Linee | |
| ISOFORD_PS | 0x8017 | Switched K Linee | |
| KW81_PS | 0x8018 | 7K Linee | |
| KW82_PS | 0x8019 | 7K Linee | |
| MB_PS | 0x801A | Switched K Linee | |
| MBHFM_PS | 0x801B | 7K Linee | |
| NISSAN_PS | 0x801C | 12K 13L Line | |
| MITSUBISHI_PS | 0x801D | 7K Linee | |
| PEUGEOT_PS | 0x801E | Switched K Linee | |
| TOYOTA_PS | 0x801F | 7K Linee | |
| KIA_PS | 0x8020 | Switched K Linee | |
| WABKO_PS | 0x8021 | Switched K Line | |
| J4_PS | 0x8022 | 7K Linee | |
| ALDL160_PS | 0x8023 | Switched K Linee | |
| CUMMINS | 0x8024 | 6H, 14L CAN |
| Constant name | bit | Description |
|---|---|---|
| ISO9141_K_LINE | 12 | Use of the L line for protocol initialization. 0 = Both the L line and the K line are used for initialization 1 = Only the K line is used for initialization |
| CAN_ID_BOTH | 11 | Reception of both CAN identifier types for the CAN and ISO 15765 protocols (see also bit 8) 0 = An 11-bit or 29-bit identifier is used as defined by bit 8 1 = Both 11-bit and 29-bit identifiers are accepted by the adapter. The setting of bit 8 is ignored. |
| ISO9141_NO_CHECKSUM | 3 | Packet checksum verification for ISO9141 and ISO14230 0 = The adapter generates and verifies the checksum as defined by the ISO 9141-2 and ISO 14230-2 standards. 1 = The adapter does not generate or verify the checksum. |
| CAN_29BIT_ID | 8 | CAN identifier type for the CAN and ISO 15765 protocols 0 = Packets with an 11-bit identifier are accepted. 1 = Packets with a 29-bit identifier are accepted. |
| Definition | Description |
|---|---|
| STATUS_NOERROR | Function completed successfully |
| ERR_DEVICE_NOT_CONNECTED | No connection to the adapter. Possible causes: the adapter is powered off, there is no network, or the IP address is set incorrectly. |
| ERR_INVALID_DEVICE_ID | A non-existent adapter identifier DeviceID was specified |
| ERR_NOT_SUPPORTED | SCI protocols are not supported by the adapter. This error also occurs when incompatible protocols are specified. For example, VPW and PWM are specified at the same time |
| ERR_INVALID_PROTOCOL_ID | A non-existent ProtocolID was specified. |
| ERR_NULL_PARAMETER | The pDeviceID pointer was not specified. |
| ERR_INVALID_FLAGS | A non-existent flag was specified |
| ERR_INVALID_BAUDRATE | An incorrect baud rate was specified |
| ERR_CHANNEL_IN_USE | The channel is already in use. Defined by the J2534 standard.
In practice this error code never appears, because calling the PassThruConnect command again automatically triggers the PassThruDisconnect command and the channel is reopened.
|
| ERR_FAILED | An internal error in the DLL or in the adapter firmware, such as a memory allocation error or a stack failure. To get details, use the PassThruGetLastError() function |
#include "j2534_lib.hpp"
unsigned long DeviceID;
long Ret;
unsigned long ChannelID;
unsigned long Flags = ISO9141_K_LINE_ONLY;
Ret = PassThruConnect(DeviceID, ISO14230, Flags, 10400, &ChannelID);
if (Ret != STATUS_NOERROR)
{ // Error handling
}