How can I log the J2534 calls my application makes for debugging?
The Openport 2.0 J2534 DLL has debugging options which are settable via an IOCTL call that provide debug output for every subsequent J2534 call that is made. You can turn this debugging on by making the following J2534 call:
// the following are defined in the above header
// #define TX_IOCTL_BASE 0x70000
// #define TX_IOCTL_SET_DLL_DEBUG_FLAGS (TX_IOCTL_BASE+1)
// #define TX_IOCTL_DLL_DEBUG_FLAG_J2534_CALLS 0x00000001
unsigned int flags = TX_IOCTL_DLL_DEBUG_FLAG_J2534_CALLS;
// now use the J2534 DLL as you wish (open, connect, etc.)
Once the debugging is turned on, you can capture the output in any Windows debugger or dbgview. Notice that this call can be made as soon as the DLL is loaded, before connecting to any device, allowing you to log even the opening and closing of the device. Keep in mind that the debug output can significantly slow the throughput of the DLL - do not leave the debugging on all of the time.