The function establishes communication according to the specified protocol. To protect your program and also to share access to the program functionality, the PassThruSecurityConnect command.
long PassThruConnect (unsigned long DeviceID, unsigned long ProtocolID, unsigned long Flags, unsigned long BaudRate, unsigned long *pChannelID)
Definition | output | Description |
---|---|---|
J1850VPW | 2 VPW | Defined by SAE J1850 and SAE J2178 It can work simultaneously with CAN and ISO15765. Not compatible with dial-up protocols. |
J1850PWM | 2, 10 PWM | Defined by SAE J1850 It can work simultaneously with CAN and ISO15765, Not compatible with dial-up protocols. |
ISO9141 | 7K,15L Line | Defined by ISO 9141 and SAE J1979 It can work simultaneously with CAN and ISO15765. Not compatible with dial-up protocols. |
ISO14230 | 7K,15L Line | |
CAN | 6H,14L CAN | Not processed CAN stream. It can simultaneously work with all protocols. |
ISO15765 | 6H,14L CAN | Defined by ISO 15765-4 and ISO 14229-1 UDS It can simultaneously work 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 SAE J1850 and SAE J2178 It can work simultaneously with CAN and ISO15765. Not compatible with dial-up protocols. |
J1850PWM_PS | Switched PWM | Defined by SAE J1850 It can work simultaneously with CAN and ISO15765, Not compatible with dial-up protocols. |
ISO9141_PS | Switched K L Line | Defined by ISO 9141 and SAE J1979 It can work simultaneously with CAN and ISO15765. Not compatible with dial-up protocols. |
ISO14230_PS | Switched K L Line | Defined by ISO 9141 and SAE J1979 It can work simultaneously with CAN and ISO15765. Not compatible with dial-up protocols. |
CAN_PS | Switched CAN | Not processed CAN stream. It can simultaneously work with all protocols. |
ISO15765_PS | Switched CAN | |
J2610_PS | Switched /td> | |
SW_ISO15765_PS | 1 CAN | |
SW_CAN_PS | 1 CAN | |
GM_UART_PS | Switched K Line |
Definition | Code | output | Description |
---|---|---|---|
TP1_6_PS | 0x800A | 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 Line | |
ISO8_PS | 0x8014 | Switched K Line | |
DS2_PS | 0x8015 | Switched K Line | |
DAIHATSU_PS | 0x8016 | 7K Line | |
ISOFORD_PS | 0x8017 | Switched K Line | |
KW81_PS | 0x8018 | 7K Line | |
KW82_PS | 0x8019 | 7K Line | |
MB_PS | 0x801A | Switched K Line | |
MBHFM_PS | 0x801B | 7K Line | |
NISSAN_PS | 0x801C | 12K 13L Line | |
MITSUBISHI_PS | 0x801D | 7K Line | |
PEUGEOT_PS | 0x801E | Switched K Line | |
TOYOTA_PS | 0x801F | 7K Line | |
KIA_PS | 0x8020 | Switched K Line | |
WABKO_PS | 0x8021 | Switched K Lin | |
J4_PS | 0x8022 | 7K Line | |
ALDL160_PS | 0x8023 | Switched K Line | |
CUMMINS | 0x8024 | 6H, 14L CAN |
Name of the constant | bit | Description |
---|---|---|
ISO9141_K_LINE | 12 | Using the L line to initialize the protocols. 0 = Using the L-line and the K-line to initialize. 1 = Only the K-line to initialize. |
CAN_ID_BOTH | 11 | Reception of both types of CAN identifiers for CAN and ISO 15765 protocols (see also bit 8) 0 = An 11 or 29 bit identifier is used as defined by bit 8 1 = 11 and 29 bit identifiers are accepted by the adapter. The setting of bit 8 is ignored. |
ISO9141_NO_CHECKSUM | 3 | Checking the checksum of a packet for ISO9141 and ISO14230 0 = The adapter generates and verifies the checksum as defined by ISO 9141-2 and ISO 14230-2. 1 = The adapter does not generate and does not verify the checksum. |
CAN_29BIT_ID | 8 | CAN identifier type for CAN and ISO 15765 protocols 0 = Packets with 11 bit identifiers are accepted. 1 = Packets with 29 bit identifiers are accepted. |
Definition | Description |
---|---|
STATUS_NOERROR | Function completed successfully |
ERR_DEVICE_NOT_CONNECTED | No connection to adapter. Possible reasons: The adapter is turned off, there is no network, or the IP address is not set correctly. |
ERR_INVALID_DEVICE_ID | Set a non-existent adapter ID DeviceID |
ERR_NOT_SUPPORTED | SCI protocols on 04/04/16 are not yet supported by the adapter. This error also occurs if incompatible protocols are specified. For example, VPW and PWM are set simultaneously. |
ERR_INVALID_PROTOCOL_ID | A non-existent ProtocolID is specified. |
ERR_NULL_PARAMETER | The pDeviceID pointer is not specified. |
ERR_INVALID_FLAGS | A flag does not exist |
ERR_INVALID_BAUDRATE | Wrong exchange rate set |
ERR_CHANNEL_IN_USE | The channel is already in use. Defined by the J2534 standard.
In reality, this error code will never appear. When the PassThruConnect command is called again, the PassThruDisconnect command is automatically called and the channel is reopened.
|
ERR_FAILED | Defined by the J2534 standard. In the adapter, it is not used for this 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
}