iandiehard / diag-client-lib Goto Github PK
View Code? Open in Web Editor NEWDiagnostic Client library for diagnosing Automotive ECU, based on Adaptive Autosar Standard
License: Mozilla Public License 2.0
Diagnostic Client library for diagnosing Automotive ECU, based on Adaptive Autosar Standard
License: Mozilla Public License 2.0
The issue occurred in lines 523 to 528 of the file doip_diagnostic_message_handler.cpp
// Add source address
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>((diagnostic_request->GetSa() & 0xFF00) >> 8u));
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>(diagnostic_request->GetSa() & 0x00FF));
// Add target address
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>((diagnostic_request->GetSa() & 0xFF00) >> 8u));
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>(diagnostic_request->GetSa() & 0x00FF));
This code should be modified to the following content:
// Add source address
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>((diagnostic_request->GetSa() & 0xFF00) >> 8u));
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>(diagnostic_request->GetSa() & 0x00FF));
// Add target address
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>((diagnostic_request->GetTa() & 0xFF00) >> 8u));
doip_diag_req->GetTxBuffer().emplace_back(static_cast<std::uint8_t>(diagnostic_request->GetTa() & 0x00FF));
Introduce meaningful DLT logging with LINE number & FILE name
Update the copyright year to 2024
Create dynamic logger by reading for json config file
"Logger": { "LogMode": "DLT" },
"Logger": { "LogMode": "CONSOLE" },
Add License in diag client library
Add the proper example and documentation
Add proper error logging
Add a release note
Update ReadMe file
Description:
Create a pipeline job to run the gtest
Description:-
Openssl is needed to support TLS in doip client. Therefore we must find a way to integrate openssl https://github.com/openssl/openssl
Task:-
there may be a potential error in file diag-client-lib/lib/utility-support/utility/sync_timer.h:
function Start get mutex_lock_, then wait_until(blocked). if function Stop is called to cancel before timeout, it shall not work because mutex_lock_ is occupied in function Start, we can't get mutex_lock_ in function Stop then and it shall stay blocked until mutex_lock_ is released out of scope in function Start after timeout
Hi
Any progress on the TLS subject? I would like to work on it. #enhancement
Description:-
This story targets to build diag-client-lib on windows platform
After some refactoring done in appl , we need to update the example src code with new changes
Description:-
Currently DoIP only supports unsecured connection with server. This story will create a utility class that will provide the support to secure the tcp socket with TLS connection
Task:-
This story must be started after Openssl is integrated
Description:-
Currently diag-client-lib creates multiple thread during its lifetime. The main task of this story is give meaningful name to each of its threads when instantiating it.
Create a thread utility class which takes thread name from the user and create a thread with provided name.
Replace the std::thread with new thread class all over the component
when linking diag-client-example-1.exe, errors like [undefined reference to `xxxxx'] occurred,
what's wrong with it? Is it because of using a boost version lower than 1.79?
PS D:\diag-client-lib-main\build> cmake .. -G "MinGW Makefiles" -DBoost_INCLUDE_DIR=D:\boost_1_76_0 -DBoost_USE_STATIC_LIBS=ON -DBUILD_EXAMPLES=ON
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/MinGW/bin/gcc.exe - skipped
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/MinGW/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: D:\boost_1_76_0 (found suitable version "1.76.0", minimum required is "1.76.0")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done (4.8s)
-- Generating done (0.3s)
-- Build files have been written to: D:/diag-client-lib-main/build
PS D:\diag-client-lib-main\build> cmake --build .
[ 2%] Building CXX object diag-client-lib/lib/utility-support/CMakeFiles/utility-support.dir/utility/logger.cpp.obj
[ 5%] Linking CXX static library libutility-support.a
[ 5%] Built target utility-support
[ 8%] Building CXX object diag-client-lib/lib/boost-support/CMakeFiles/boost-support.dir/socket/tcp/tcp_client.cpp.obj
[ 11%] Building CXX object diag-client-lib/lib/boost-support/CMakeFiles/boost-support.dir/socket/tcp/tcp_server.cpp.obj
[ 13%] Building CXX object diag-client-lib/lib/boost-support/CMakeFiles/boost-support.dir/socket/udp/udp_client.cpp.obj
[ 16%] Linking CXX static library libboost-support.a
[ 16%] Built target boost-support
[ 19%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/channel/tcp_channel.cpp.obj
[ 22%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/channel/tcp_channel_handler_impl.cpp.obj
[ 25%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/channel/tcp_channel_state_impl.cpp.obj
[ 27%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/channel/udp_channel.cpp.obj
[ 30%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/channel/udp_channel_handler_impl.cpp.obj
[ 33%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/channel/udp_channel_state_impl.cpp.obj
[ 36%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/handler/tcp_transport_handler.cpp.obj
[ 38%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/handler/udp_transport_handler.cpp.obj
[ 41%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/sockets/tcp_socket_handler.cpp.obj
[ 44%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/sockets/udp_socket_handler.cpp.obj
[ 47%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/connection/connection_manager.cpp.obj
[ 50%] Building CXX object diag-client-lib/lib/doip-client/CMakeFiles/doip-client.dir/doip_transport_protocol_handler.cpp.obj
[ 52%] Linking CXX static library libdoip-client.a
[ 52%] Built target doip-client
[ 55%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/diagnostic_client.cpp.obj
[ 58%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/diagnostic_client_impl.cpp.obj
[ 61%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/common/diagnostic_manager.cpp.obj
[ 63%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/common/diagnostic_manager_plugin_factory.cpp.obj
[ 66%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/dcm/dcm_client.cpp.obj
[ 69%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/dcm/connection/uds_transport_protocol_manager.cpp.obj
[ 72%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/dcm/conversation/conversation_manager.cpp.obj
[ 75%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/dcm/conversation/dm_conversation.cpp.obj
[ 77%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/dcm/conversation/dm_conversation_state_impl.cpp.obj
[ 80%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/dcm/conversation/vd_conversation.cpp.obj
[ 83%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/dcm/service/dm_uds_message.cpp.obj
[ 86%] Building CXX object diag-client-lib/appl/CMakeFiles/diag-client.dir/src/dcm/service/vd_message.cpp.obj
[ 88%] Linking CXX static library libdiag-client.a
[ 88%] Built target diag-client
[ 91%] Building CXX object examples/example_1/CMakeFiles/diag-client-example-1.dir/src/main.cpp.obj
[ 94%] Linking CXX executable diag-client-example-1.exe
../../diag-client-lib/lib/doip-client/libdoip-client.a(connection_manager.cpp.obj):connection_manager.cpp:(.text$_ZN5boost4asio6detail17winsock_init_base7startupERNS2_4dataEhh[_ZN5boost4asio6detail17winsock_init_base7startupERNS2_4dataEhh]+0x7a): undefined reference to __imp_WSAStartup' ../../diag-client-lib/lib/doip-client/libdoip-client.a(connection_manager.cpp.obj):connection_manager.cpp:(.text$_ZN5boost4asio6detail17winsock_init_base7cleanupERNS2_4dataE[_ZN5boost4asio6detail17winsock_init_base7cleanupERNS2_4dataE]+0x35): undefined reference to
__imp_WSACleanup'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops16clear_last_errorEv[_ZN5boost4asio6detail10socket_ops16clear_last_errorEv]+0x10): undefined reference to __imp_WSASetLastError' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops14get_last_errorERNS_6system10error_codeEb[_ZN5boost4asio6detail10socket_ops14get_last_errorERNS_6system10error_codeEb]+0x49): undefined reference to
__imp_WSAGetLastError'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops5closeEyRhbRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops5closeEyRhbRNS_6system10error_codeE]+0xa3): undefined reference to __imp_closesocket' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops5closeEyRhbRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops5closeEyRhbRNS_6system10error_codeE]+0x147): undefined reference to
__imp_ioctlsocket'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops5closeEyRhbRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops5closeEyRhbRNS_6system10error_codeE]+0x164): undefined reference to __imp_closesocket' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops21set_user_non_blockingEyRhbRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops21set_user_non_blockingEyRhbRNS_6system10error_codeE]+0x64): undefined reference to
__imp_ioctlsocket'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops8shutdownEyiRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops8shutdownEyiRNS_6system10error_codeE]+0x3e): undefined reference to __imp_shutdown' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops4recvEyP7_WSABUFyiRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops4recvEyP7_WSABUFyiRNS_6system10error_codeE]+0x5d): undefined reference to
__imp_WSARecv'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops4sendEyPK7_WSABUFyiRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops4sendEyPK7_WSABUFyiRNS_6system10error_codeE]+0x5e): undefined reference to __imp_WSASend' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops6socketEiiiRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops6socketEiiiRNS_6system10error_codeE]+0x3d): undefined reference to
__imp_WSASocketW'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops6socketEiiiRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops6socketEiiiRNS_6system10error_codeE]+0x9b): undefined reference to __imp_setsockopt' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops9poll_readEyhiRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops9poll_readEyhiRNS_6system10error_codeE]+0x187): undefined reference to
__imp_select'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops10poll_writeEyhiRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops10poll_writeEyhiRNS_6system10error_codeE]+0x186): undefined reference to __imp_select' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops12poll_connectEyiRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops12poll_connectEyiRNS_6system10error_codeE]+0x1df): undefined reference to
__imp_select'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops9inet_ntopEiPKvPcymRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops9inet_ntopEiPKvPcymRNS_6system10error_codeE]+0xe7): undefined reference to __imp_WSAAddressToStringA' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops9inet_ptonEiPKcPvPmRNS_6system10error_codeE[_ZN5boost4asio6detail10socket_ops9inet_ptonEiPKcPvPmRNS_6system10error_codeE]+0x76): undefined reference to
__imp_WSAStringToAddressA'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops20network_to_host_longEm[_ZN5boost4asio6detail10socket_ops20network_to_host_longEm]+0x11): undefined reference to __imp_ntohl' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops20host_to_network_longEm[_ZN5boost4asio6detail10socket_ops20host_to_network_longEm]+0x11): undefined reference to
__imp_htonl'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops21network_to_host_shortEt[_ZN5boost4asio6detail10socket_ops21network_to_host_shortEt]+0x17): undefined reference to __imp_ntohs' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops21host_to_network_shortEt[_ZN5boost4asio6detail10socket_ops21host_to_network_shortEt]+0x17): undefined reference to
__imp_htons'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops9call_bindIiEEiMNS2_6msghdrET_yPK8sockaddry[_ZN5boost4asio6detail10socket_ops9call_bindIiEEiMNS2_6msghdrET_yPK8sockaddry]+0x2f): undefined reference to __imp_bind' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops12call_connectIiEEiMNS2_6msghdrET_yPK8sockaddry[_ZN5boost4asio6detail10socket_ops12call_connectIiEEiMNS2_6msghdrET_yPK8sockaddry]+0x2f): undefined reference to
__imp_connect'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops15call_setsockoptIiEEiMNS2_6msghdrET_yiiPKvy[_ZN5boost4asio6detail10socket_ops15call_setsockoptIiEEiMNS2_6msghdrET_yiiPKvy]+0x3e): undefined reference to __imp_setsockopt' ../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops15call_getsockoptIiEEiMNS2_6msghdrET_yiiPvPy[_ZN5boost4asio6detail10socket_ops15call_getsockoptIiEEiMNS2_6msghdrET_yiiPvPy]+0x3d): undefined reference to
__imp_getsockopt'
../../diag-client-lib/lib/boost-support/libboost-support.a(tcp_client.cpp.obj):tcp_client.cpp:(.text$_ZN5boost4asio6detail10socket_ops16call_getpeernameIiEEiMNS2_6msghdrET_yP8sockaddrPy[_ZN5boost4asio6detail10socket_ops16call_getpeernameIiEEiMNS2_6msghdrET_yP8sockaddrPy]+0x37): undefined reference to __imp_getpeername' et_ops6sendtoEyPK7_WSABUFyiPK8sockaddryRNS_6system10error_codeE]+0x70): undefined reference to
__imp_WSASendTo'
../../diag-client-lib/lib/boost-support/libboost-support.a(udp_client.cpp.obj):udp_client.cpp:(.text$_ZN5boost4asio6detail28win_iocp_socket_service_base21start_receive_from_opERNS2_24base_implementation_typeEP7_WSABUFyP8sockaddriPiPNS1_18win_iocp_operationE[_ZN5boost4asio6detail28win_iocp_socket_service_base21start_receive_from_opERNS2_24base_implementation_typeEP7_WSABUFyP8sockaddriPiPNS1_18win_iocp_operationE]+0xcd): undefined reference to __imp_WSARecvFrom' ../../diag-client-lib/lib/boost-support/libboost-support.a(udp_client.cpp.obj):udp_client.cpp:(.text$_ZN5boost4asio6detail28win_iocp_socket_service_base21start_receive_from_opERNS2_24base_implementation_typeEP7_WSABUFyP8sockaddriPiPNS1_18win_iocp_operationE[_ZN5boost4asio6detail28win_iocp_socket_service_base21start_receive_from_opERNS2_24base_implementation_typeEP7_WSABUFyP8sockaddriPiPNS1_18win_iocp_operationE]+0xd9): undefined reference to
__imp_WSAGetLastError'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[2]: *** [examples\example_1\CMakeFiles\diag-client-example-1.dir\build.make:103: examples/example_1/diag-client-example-1.exe] Error 1
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:378: examples/example_1/CMakeFiles/diag-client-example-1.dir/all] Error 2
mingw32-make.exe: *** [Makefile:135: all] Error 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.