Quantex GmbH
Your region: Europe

PassThruSecurityConnect Opening a secure protocol connection

Description

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)

Parameters

Return error codes

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

Example

#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
}