This library helps to debug software that uses the API for PassThru Vehicle Reprogramming (SAE J2534-1). It captures all necessary information to debug problems and presents that information to engineers in a human-readable form.
This software:
* Is intended for engineers. If you are not an engineer you can probably stop reading.
* Acts like a shim between the J2534-application and the J2534-device
* Works with any J2534-compliant vehicle interface
* Can be fully-integrated with an application or used with no changes at all
After loading a J2534 DLL the shim will continuously log debugging information to an internal circular memory-buffer and automatically capture a description string using PassThruGetLastError for most errors. This buffer can be saved to a UTF-8 encoded text file. Please refer to j2534-logger API documentation for details.
# Used when built-into an application
The preferred technique is to link `ptshim32.dll` with a J2534 application. Although this requires some small changes to a J2534 application, your application will have complete control and the shim will never popup an unexpected dialog box.
This library exports the standard PassThru functions plus 5 new functions:
```
long J2534_API PassThruLoadLibrary(char *szFunctionLibrary);
long J2534_API PassThruWriteToLogA(char *szMsg);
long J2534_API PassThruWriteToLogW(wchar_t *szMsg);
long J2534_API PassThruSaveLog(char *szFilename);
long J2534_API PassThruUnloadLibrary();
```
Like normal, the application should search the registry for installed J2534 devices. After the user selects a J2534 interface the application should call:
```
// Assume szFunctionLibrary is a NULL terminated ANSI string that contains
// the pathname to the J2534 DLL that we want to load
char * szFunctionLibrary = "c:\windows\system32\cdpls432.dll";
ptStatus = PassThruLoadLibrary(szFunctionLibrary);
```
The shim will load the desired DLL and start recording debugging information to a circular memory-buffer. The application may insert its own debugging text to the log with:
```
// For ANSI (char *) text
PassThruWriteToLogA("Adding an ANSI line to debug log");
// For UNICODE (wchar_t *) text
PassThruWriteToLogW(_T("Adding a UNICODE line to debug log"));
```
At any point the application can save the memory-buffer to a file by calling:
```
// Assume szFilename is a NULL terminated ANSI string that contains
// the pathname to the J2534 DLL that we want to load
char * szFilename = "C:\Users\Public\Documents\logfile.txt";
PassThruSaveLog(szFilename);
```
# Used like a PassThru vehicle interface
It is also possible to record debugging information with no changes to the original application. In this case you would compile `ptshim32.dll` with ALLOW_POPUP defined and list `ptshim32.dll` under the PassThruSupport.04.04 registry key like a normal J2534 Interface. Alternately you can download and install j2534-logger.msi.
The first function call (typically PassThruOpen) will open a dialog box:
- __Browse__: Allows you to choose an output filename.
- __Config__: Launches the device's configuration software, listed in the ConfigApplication registry key. This button is disabled if the EXE is not accessible.
- __OK__: Attempts to load the selected J2534 DLL, listed in the FunctionLibrary registry key. This button is disabled if the DLL is not accessible.
- __Cancel__: Exits without loading any J2534 DLL. The function call will return ERR_FAILED and the next function call will present the dialog again.
Once you select a J2534 interface you'll be "married" to that one until `ptshim32.dll` is unloaded or the process terminates. All debugging information will be written to the specified file.
没有合适的资源?快使用搜索试试~ 我知道了~
用于PassThru车辆重新编程的调试库(SAEJ2534)_C++_C_下.zip
共33个文件
h:10个
cpp:8个
svn-base:2个
需积分: 5 3 下载量 91 浏览量
2023-04-07
23:57:51
上传
评论
收藏 60KB ZIP 举报
温馨提示
用于PassThru车辆重新编程的调试库(SAEJ2534)_C++_C_下
资源推荐
资源详情
资源评论
收起资源包目录
用于PassThru车辆重新编程的调试库(SAEJ2534)_C++_C_下.zip (33个子文件)
j2534-logger-master
ptshim32
stdafx.h 1KB
ptshim.h 440B
shim_debug.cpp 20KB
shim_debug.h 2KB
resource.h 728B
ptshim.rc 4KB
ptshim32.def 596B
shim_output.cpp 4KB
res
.svn
prop-base
ptshim.rc2.svn-base 30B
text-base
ptshim.rc2.svn-base 397B
entries 363B
all-wcprops 172B
ptshim.rc2 397B
shim_output.h 939B
j2534_v0404.h 16KB
ptshim32.vcproj 6KB
shim_frontend.h 3KB
SelectionBox.h 1KB
shim_loader.cpp 11KB
ptshim.cpp 1KB
SelectionBox.cpp 7KB
shim_frontend.cpp 16KB
stdafx.cpp 208B
targetver.h 1KB
shim_loader.h 2KB
LICENSE 34KB
shim_example
shim_example.vcproj 4KB
main.cpp 4KB
installer
j2534-logger.wxs 5KB
installer.wixproj 2KB
license.rtf 8KB
j2534-logger.sln 4KB
README.md 4KB
共 33 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功