========compile SocketCAN userspace utilities and tools for Android ============================
---install cmake 3.6  ---
(reference from http://www.kbase101.com/question/8509.html)
.first check cmake version via "cmake --version" , it should 3.6.
.if vesion is not 3.6, rmove it via "sudo apt remove cmake"

.goto https://cmake.org/download/ , download 3.6 version source code
 file name cmake-3.6.0-Linux-x86_64.sh, save to o:\tools\cmake36\ , and switch to folder
.chmod +x cmake-3.6.2-Linux-x86_64.sh   //add execute permission
../cmake-3.6.2-Linux-x86_64.sh  // install it, folder will be \tools\cmake36\cmake-3.6.0-Linux-x86_64\
.create link
 sudo ln -s /home/bgbg2/tools/cmake36/cmake-3.6.0-Linux-x86_64/bin/* /usr/local/bin
.check version via "cmake --version", it should be 3.6 now.

--install Android NDK R20---
goto
https://developer.android.com/ndk/downloads
download Linux 64-bit (x86)    android-ndk-r20-linux-x86_64.zip
.download Android NDK R20 and unzip to folder o:\tools\android-ndk-r20\


---compile linux-can/can-utils for Android ---
download source code from below web site: 
https://github.com/linux-can/can-utils

.download can-utils-master.zip , and unzip
.switch to unzip folder - o:\tools\can-utils-master\
.make build floder by "mkdir build" and switch in build foler "cd build", under  o:\tools\can-utils-master\build\
.under under  o:\tools\can-utils-master\build\ folder.
.type " cmake -DCMAKE_TOOLCHAIN_FILE=/home/bgbg2/tools/android-ndk-r20/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-21 -DANDROID_ABI=arm64-v8a   .. && make " 
to build binary for anrdoid.
.now ,can relate bin file generate in o:\tools\can-utils-master\build\ folder.
.copy those file to Andorid and try.

 

---test on Andorid device (Android 9) for example--

adb root
d:\660img>adb push canutilmaster-android /data/
canutilmaster-android\: 25 files pushed. 1.0 MB/s (853158 bytes in 0.811s)

adb root
adb shell
cd data/canutilmaster-android

CK65-L0-C:/data/canutilmaster-android # chmod 777 *
CK65-L0-C:/data/canutilmaster-android # ls -al
total 892
drwxrwx--x  2 system system  4096 2019-09-09 04:54 .
drwxrwx--x 44 system system  4096 2019-09-09 04:54 ..
-rwxrwxrwx  1 root   root   35126 2019-09-09 09:29 Makefile
-rwxrwxrwx  1 root   root   41344 2019-09-09 09:29 asc2log
-rwxrwxrwx  1 root   root   23344 2019-09-09 09:29 bcmserver
-rwxrwxrwx  1 root   root   29496 2019-09-09 09:29 can-calc-bit-timing
-rwxrwxrwx  1 root   root   32456 2019-09-09 09:29 canbusload
-rwxrwxrwx  1 root   root   65200 2019-09-09 09:29 candump
-rwxrwxrwx  1 root   root   28712 2019-09-09 09:29 canfdtest
-rwxrwxrwx  1 root   root   53872 2019-09-09 09:29 cangen
-rwxrwxrwx  1 root   root   47672 2019-09-09 09:29 cangw
-rwxrwxrwx  1 root   root   46360 2019-09-09 09:29 canlogserver
-rwxrwxrwx  1 root   root   54864 2019-09-09 09:29 canplayer
-rwxrwxrwx  1 root   root   34136 2019-09-09 09:29 cansend
-rwxrwxrwx  1 root   root   38872 2019-09-09 09:29 cansniffer
-rwxrwxrwx  1 root   root   35952 2019-09-09 09:29 isotpdump
-rwxrwxrwx  1 root   root   23432 2019-09-09 09:29 isotpperf
-rwxrwxrwx  1 root   root   18816 2019-09-09 09:29 isotprecv
-rwxrwxrwx  1 root   root   18768 2019-09-09 09:29 isotpsend
-rwxrwxrwx  1 root   root   27936 2019-09-09 09:29 isotpserver
-rwxrwxrwx  1 root   root   26168 2019-09-09 09:29 isotpsniffer
-rwxrwxrwx  1 root   root   27960 2019-09-09 09:29 isotptun
-rwxrwxrwx  1 root   root   34064 2019-09-09 09:29 log2asc
-rwxrwxrwx  1 root   root   30928 2019-09-09 09:29 log2long
-rwxrwxrwx  1 root   root   20168 2019-09-09 09:29 slcan_attach
-rwxrwxrwx  1 root   root   29480 2019-09-09 09:29 slcand
-rwxrwxrwx  1 root   root   28032 2019-09-09 09:29 slcanpty

arrow
arrow
    文章標籤
    canutil for Android canutil
    全站熱搜

    CuteParrot 發表在 痞客邦 留言(0) 人氣()