The function terminates the connection with the adapter. 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 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_FAILED | Defined by the J2534 standard. In the adapter, 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
}