diff --git a/bcdrivertinycan.cpp b/bcdrivertinycan.cpp index c3a33e0..0012ae3 100644 --- a/bcdrivertinycan.cpp +++ b/bcdrivertinycan.cpp @@ -36,13 +36,22 @@ #include +#if defined(Q_OS_WIN) + static const char* cMHS_DRIVERNAME = NULL; +#elif defined(Q_OS_LINUX) +// Linux-spezifischer Code (z.B. /proc Filesystem, D-Bus) + static const char* cMHS_DRIVERNAME = "libmhstcan.so"; +#endif + +//const char* CBCDLL_LIN = "libmhstcan.so"; +//const char* CBCDLL_WIN = "mhstcan.dll"; + /** * @brief Destruktor. Entlädt den CAN-Bus Treiber wieder. */ BCDriverTinyCan::~BCDriverTinyCan() { - resetDriver(); } @@ -72,7 +81,7 @@ BCDriver::DriverStateResult BCDriverTinyCan::loadDriver() { qDebug() << " -- Hier!"; //if( ::LoadDriver( NULL ) < 0 ) - if( ::LoadDriver( "libmhstcan.so" ) < 0 ) + if( ::LoadDriver( cMHS_DRIVERNAME ) < 0 ) return std::unexpected(QString("Driver Error: 'LoadDriver'")); _driverState = DriverState::Loaded; return _driverState; diff --git a/bcdrivertinycan.h b/bcdrivertinycan.h index 2c0bad3..e6c42fa 100644 --- a/bcdrivertinycan.h +++ b/bcdrivertinycan.h @@ -55,8 +55,6 @@ private: BCDriver::DriverStateResult setConsoleSlaveMode(); - //const char* CBCDLL_LIN = "libmhstcan.so"; - //const char* CBCDLL_WIN = "mhstcan.dll"; static constexpr int cRetries = 5; static constexpr int cTimeOuts = 20; diff --git a/doc/Install.on.pi.txt b/doc/Install.on.pi.txt index f904c6e..14b4970 100644 --- a/doc/Install.on.pi.txt +++ b/doc/Install.on.pi.txt @@ -27,12 +27,14 @@ sudo apt purge modemmanager // --- -$ sudo chgrp pi /opt -$ sudo chmod -R 775 /opt -$ cd /opt -$ mv /home/pi/tiny_can_raspberry_790.tar.gz . -$ tar -xzvf tiny_can_raspberry_790.tar.gz -$ rm tiny_can_raspberry_790.tar.gz +https://github.com/MHS-Elektronik/OBD-Display + + sudo chgrp pi /opt + sudo chmod -R 775 /opt + cd /opt + mv /home/pi/tiny_can_raspberry_790.tar.gz . + tar -xzvf tiny_can_raspberry_790.tar.gz + rm tiny_can_raspberry_790.tar.gz diff --git a/doc/~$allenges.docx b/doc/~$allenges.docx deleted file mode 100644 index 3676d3d..0000000 Binary files a/doc/~$allenges.docx and /dev/null differ diff --git a/doc/~WRL0643.tmp b/doc/~WRL0643.tmp deleted file mode 100644 index df96f2b..0000000 Binary files a/doc/~WRL0643.tmp and /dev/null differ