The function terminates the connection with the VCI. The command should be executed when the program terminates. This automatically closes all open protocols using the PassThruDiconnect command.
long PassThruClose(unsigned long DeviceID)
| Definition | Description |
|---|---|
| STATUS_NOERROR | Function completed successfully |
| ERR_DEVICE_NOT_CONNECTED | No connection to the VCI. Possible reasons: The VCI is turned off, there is no network, or the IP address is not set correctly. |
| ERR_INVALID_DEVICE_ID | Set a non-existent device ID DeviceID |
| ERR_FAILED | Defined by the J2534 standard. In the VCI, it is not used for this function. |
#include "j2534_lib.hpp"
unsigned long DeviceID;
unsigned long Ret;
Ret = PassThruClose(DeviceID);
if (Ret != STATUS_NOERROR)
{
// Error handling
}