Skip to content

Commit

Permalink
Devel2.1.2 (#74)
Browse files Browse the repository at this point in the history
* get bitrate from socketcan
* docs and version update
  • Loading branch information
meeludwig authored May 12, 2023
1 parent 965becb commit da5c62c
Show file tree
Hide file tree
Showing 7 changed files with 236 additions and 132 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/).

### 2.1.2
- read bitrate from socketcan for "Unsepcified" parameters, so that the statistics works. If 0, stats do not work entirely


### 2.1.1 [ 18.april.2023 ]
- validated version for CanOpenNG
- lots of features and changes


### 2.0.25 [ 16.march.2023 ]
we have 4 types of signals
Expand Down
17 changes: 2 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
#
cmake_minimum_required( VERSION 3.0 )
project( CanModuleProject LANGUAGES C CXX VERSION 2.0.25 )
project( CanModuleProject LANGUAGES C CXX VERSION 2.1.2 )
message(STATUS "[${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}]: CanModule version= ${PROJECT_VERSION}" )

cmake_policy(SET CMP0054 NEW)
Expand Down Expand Up @@ -70,23 +70,12 @@ function ( clone_LogIt )
message(STATUS "[${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}]: cloning LogIt from github. *NOTE* cloning version [${LOGIT_VERSION}]")
if ( NOT EXISTS ${PROJECT_BINARY_DIR}/LogIt )
execute_process(COMMAND mkdir -p ${PROJECT_BINARY_DIR} )
#execute_process(COMMAND pwd )
#execute_process(COMMAND git clone -b ${LOGIT_VERSION} https://github.com/quasar-team/LogIt.git WORKING_DIRECTORY ${PROJECT_BINARY_DIR} )
#xxxx
execute_process(COMMAND git clone -b ${LOGIT_VERSION} https://github.com/quasar-team/LogIt.git ${PROJECT_BINARY_DIR}/LogIt WORKING_DIRECTORY ${PROJECT_BINARY_DIR} )


#add_subdirectory( ${PROJECT_BINARY_DIR}/LogIt build )
execute_process(COMMAND git clone -b ${LOGIT_VERSION} https://github.com/quasar-team/LogIt.git ${PROJECT_BINARY_DIR}/LogIt WORKING_DIRECTORY ${PROJECT_BINARY_DIR} )
include_directories( ${PROJECT_BINARY_DIR}/LogIt/include build )

#execute_process(COMMAND git clone -b ${LOGIT_VERSION} https://github.com/quasar-team/LogIt.git WORKING_DIRECTORY ./build )
message(STATUS "[${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}]: PROJECT_BINARY_DIR= ${PROJECT_BINARY_DIR}")
#message(STATUS "[${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}]: LogIt cloned into ${PROJECT_BINARY_DIR}/../LogIt")
#message(STATUS "[${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}]: LogIt cloned into ./build/LogIt")
ELSE()
message(STATUS "[${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}]: Logit is already cloned into ${PROJECT_BINARY_DIR}/LogIt" )
ENDIF()
#set ( LOGIT_HEADERS ${PROJECT_BINARY_DIR}/LogIt/include ) # some bw compatibility, otherwise maybe useless
include_directories( ${PROJECT_BINARY_DIR}/LogIt/include )

endfunction()
Expand Down Expand Up @@ -215,8 +204,6 @@ SET ( SRCS_ALL_OS
./CanInterface/src/CanModuleUtils.cpp
./CanInterface/src/CanStatistics.cpp
./CanLibLoader/src/CanLibLoader.cpp
#./CanModuleTest/src/CanModuleTest.cpp
#./CanModuleTest/src/main.cpp
./Diagnostic/src/Diag.cpp
)
SET ( SRCS_OS_WIN
Expand Down
8 changes: 8 additions & 0 deletions CanInterfaceImplementations/sockcan/SockCanScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,14 @@ int CSockCanScan::m_openCanPort()
}
} else {
MLOGSOCK(INF,this) << "did NOT reconfigure (stop, set bitrate, start) the CAN port";
struct can_bittiming bt;
int ret = can_get_bittiming (m_channelName.c_str(), &bt);
if ( ret == 0 && bt.bitrate > 0 ){
MLOGSOCK(INF,this) << "successfully read bitrate from socketcan, statistics will work, bitrate= " << bt.bitrate;
m_CanParameters.m_lBaudRate = bt.bitrate;
} else {
MLOGSOCK(WRN,this) << "could not read bitrate from socketcan, statistics will not fully work, bitrate= " << bt.bitrate;
}
}

m_sock = socket(PF_CAN, SOCK_RAW, CAN_RAW);
Expand Down
Loading

0 comments on commit da5c62c

Please sign in to comment.