The function sends a test packet to the adapter, which returns it back.
long LinkTest(unsigned long DeviceID, unsigned long Length, unsigned char* Data)
| Definition | Description |
|---|---|
| STATUS_NOERROR | Function completed successfully |
| ERR_DEVICE_NOT_CONNECTED | No connection to the adapter. Possible causes: the adapter is turned 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_INVALID_TEST_DATA | The test packet returned from the adapter corrupted |
| ERR_INVALID_LEN_TEST_DATA | The test packet length was specified incorrectly |
#include "j2534_lib.hpp"
unsigned long DeviceID;
unsigned long Ret;
const unsigned char* TestData[] = {"Test"};
Ret = LinkTest(DeviceID, &TestData, sizeof(TestData));
if (Ret != STATUS_NOERROR)
{ // Error handling
}