77#include < string>
88
99std::mutex CanVendorSystec::m_handles_lock;
10- std::string UsbCanGetErrorText ( long err_code ); // forward declaration
10+ std::unordered_map< int , tUcanHandle> CanVendorSystec::m_handle_map;
1111
1212CanVendorSystec::CanVendorSystec (const CanDeviceArguments& args)
1313 : CanDevice(" systec" , args) {
@@ -64,7 +64,7 @@ CanReturnCode CanVendorSystec::init_can_port() {
6464 map_module_to_handle (m_module_number, can_module_handle);
6565 } else { // find existing handle of module
6666 can_module_handle = pos->second ;
67- LOG (Log::WRN , CanLogIt::h ()) << " trying to open a can port which is in use, reuse handle, skipping UCanDeinitHardware" ;
67+ LOG (Log::WRN , CanLogIt::h ()) << " trying to open a can port which is in use, reuse handle, skipping UCanDeinitHardware" ;
6868 }
6969
7070 systec_call_return = ::UcanInitCanEx2 (can_module_handle, m_channel_number, &initialization_parameters);
@@ -224,9 +224,9 @@ int CanVendorSystec::SystecRxThread()
224224{
225225 BYTE status;
226226 tCanMsgStruct read_can_message;
227- LOG (Log::DBG , CanLogIt::h ()) << " SystecRxThread Started. m_receive_thread_flag = [" << this -> m_receive_thread_flag <<" ]" ;
228- while (this -> m_receive_thread_flag ) {
229- status = UcanReadCanMsgEx (this -> m_UcanHandle , (BYTE *)&this -> m_channel_number , &read_can_message, NULL );
227+ LOG (Log::DBG , CanLogIt::h ()) << " SystecRxThread Started. m_receive_thread_flag = [" << m_receive_thread_flag <<" ]" ;
228+ while (m_receive_thread_flag) {
229+ status = UcanReadCanMsgEx (m_UcanHandle, (BYTE *)&m_channel_number, &read_can_message, NULL );
230230 switch (status) {
231231 case USBCAN_WARN_SYS_RXOVERRUN : [[ fallthrough ]] ;
232232 case USBCAN_WARN_DLL_RXOVERRUN : [[ fallthrough ]] ;
@@ -239,12 +239,12 @@ int CanVendorSystec::SystecRxThread()
239239 // id, data, flags
240240 CanFrame can_msg_copy (read_can_message.m_dwID , data, read_can_message.m_bFF );
241241 // TODO the read_can_message contains a DWORD m_dwTime "receipt time in ms"
242- this -> received (can_msg_copy);
243- // this-> m_statistics.onReceive( read_can_message.m_bDLC );
244- // this-> m_statistics.setTimeSinceReceived();
242+ received (can_msg_copy);
243+ // m_statistics.onReceive( read_can_message.m_bDLC );
244+ // m_statistics.setTimeSinceReceived();
245245
246246 // we can reset the reconnectionTimeout here, since we have received a message
247- // this-> resetTimeoutOnReception();
247+ // resetTimeoutOnReception();
248248 break ;
249249 }
250250 case USBCAN_WARN_NODATA :
@@ -264,7 +264,7 @@ int CanVendorSystec::SystecRxThread()
264264 return 0 ;
265265}
266266
267- std::string UsbCanGetErrorText ( long err_code ){
267+ std::string CanVendorSystec:: UsbCanGetErrorText ( long err_code ) {
268268 switch ( err_code ){
269269 case USBCAN_SUCCESSFUL : return (" success" );
270270
0 commit comments