I.MX6 Android can-utils 移植
/*******************************************************************
* I.MX6 Android can-utils 移植
* 说明:
* 由于最近要用到CAN,于是先移植一下can-tuils来看一下情况。
*
* 2016-8-1 深圳 南山平山村 曾剑锋
******************************************************************/ 一、获取源码:
https://github.com/linux-can/can-utils 二、错误现象:
target thumb C: slcan_attach <= /home/myzr/myandroid/packages/apps/can-utils/slcan_attach.c
/home/myzr/myandroid/packages/apps/can-utils/slcan_attach.c: In function 'main':
/home/myzr/myandroid/packages/apps/can-utils/slcan_attach.c::: error: 'N_SLCAN' undeclared (first use in this function)
/home/myzr/myandroid/packages/apps/can-utils/slcan_attach.c::: note: each undeclared identifier is reported only once for each function it appears in
make: *** [out/target/product/sabresd_6dq/obj/EXECUTABLES/slcan_attach_intermediates/slcan_attach.o] Error
make: Leaving directory `/home/myzr/myandroid' 三、查看N_SLCAN情况:
. 直接查看:
myzr@myzr:~/myandroid/packages/apps/can-utils$ grep N_SLCAN * -R
configure.ac:AC_CHECK_DECL(N_SLCAN,,
configure.ac: [AC_DEFINE([N_SLCAN], [], [N_SLCAN])]
slcan_attach.c: int ldisc = N_SLCAN;
slcand.c: int ldisc = N_SLCAN;
. 执行autogen.sh再查看:
myzr@myzr:~/myandroid/packages/apps/can-utils$ ./autogen.sh ----------
autoreconf
---------- Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf line 196.
Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf line 196.
configure.ac:: installing `config/autoconf/config.guess'
configure.ac:: installing `config/autoconf/config.sub'
configure.ac:: installing `config/autoconf/install-sh'
configure.ac:: installing `config/autoconf/missing'
GNUmakefile.am:: Libtool library used but `LIBTOOL' is undefined
GNUmakefile.am:: The usual way to define `LIBTOOL' is to add `LT_INIT'
GNUmakefile.am:: to `configure.ac' and run `aclocal' and `autoconf' again.
GNUmakefile.am:: If `LT_INIT' is in `configure.ac', make sure
GNUmakefile.am:: its definition is in aclocal's search path.
GNUmakefile.am: installing `config/autoconf/depcomp'
autoreconf: automake failed with exit status:
myzr@myzr:~/myandroid/packages/apps/can-utils$ grep N_SLCAN * -R
autom4te.cache/output.:ac_fn_c_check_decl "$LINENO" "N_SLCAN" "ac_cv_have_decl_N_SLCAN" "$ac_includes_default"
autom4te.cache/output.:if test "x$ac_cv_have_decl_N_SLCAN" = xyes; then :
autom4te.cache/output.:$as_echo "@%:@define N_SLCAN 17" >>confdefs.h
autom4te.cache/output.:ac_fn_c_check_decl "$LINENO" "N_SLCAN" "ac_cv_have_decl_N_SLCAN" "$ac_includes_default"
autom4te.cache/output.:if test "x$ac_cv_have_decl_N_SLCAN" = xyes; then :
autom4te.cache/output.:$as_echo "@%:@define N_SLCAN 17" >>confdefs.h
autom4te.cache/traces.:m4trace:configure.ac:: -- m4_pattern_allow([^N_SLCAN$])
autom4te.cache/traces.:m4trace:configure.ac:: -- AC_DEFINE_TRACE_LITERAL([N_SLCAN])
autom4te.cache/traces.:m4trace:configure.ac:: -- m4_pattern_allow([^N_SLCAN$])
autom4te.cache/traces.:m4trace:configure.ac:: -- AH_OUTPUT([N_SLCAN], [/* N_SLCAN */
autom4te.cache/traces.:@%:@undef N_SLCAN])
configure:ac_fn_c_check_decl "$LINENO" "N_SLCAN" "ac_cv_have_decl_N_SLCAN" "$ac_includes_default"
configure:if test "x$ac_cv_have_decl_N_SLCAN" = xyes; then :
configure:$as_echo "#define N_SLCAN 17" >>confdefs.h
configure.ac:AC_CHECK_DECL(N_SLCAN,,
configure.ac: [AC_DEFINE([N_SLCAN], [], [N_SLCAN])]
slcan_attach.c: int ldisc = N_SLCAN;
slcand.c: int ldisc = N_SLCAN;
myzr@myzr:~/myandroid/packages/apps/can-utils$ 四、解决办法:
slcan_attach.c slcand.c 中添加 #define N_SLCAN 17 宏定义。 五、测试命令:
root@android:/data/local # ./cangen cangen: generate CAN frames Usage: cangen [options] <CAN interface>
Options: -g <ms> (gap in milli seconds - default: ms)
-e (generate extended frame mode (EFF) CAN frames)
-f (generate CAN FD CAN frames)
-b (generate CAN FD CAN frames with bitrate switch (BRS))
-R (send RTR frame)
-m (mix -e -f -b -R frames)
-I <mode> (CAN ID generation mode - see below)
-L <mode> (CAN data length code (dlc) generation mode - see below)
-D <mode> (CAN data (payload) generation mode - see below)
-p <timeout> (poll on -ENOBUFS to write frames with <timeout> ms)
-n <count> (terminate after <count> CAN frames - default infinite)
-i (ignore -ENOBUFS return values on write() syscalls)
-x (disable local loopback of generated CAN frames)
-v (increment verbose level for printing sent CAN frames) Generation modes:
'r' => random values (default)
'i' => increment values
<hexvalue> => fix value using <hexvalue> When incrementing the CAN data the data length code minimum is set to .
CAN IDs and data content are given and expected in hexadecimal values. Examples:
cangen vcan0 -g -I 42A -L -D i -v -v (fixed CAN ID and length, inc. data)
cangen vcan0 -e -L i -v -v -v (generate EFF frames, incr. length)
cangen vcan0 -D 11223344DEADBEEF -L (fixed CAN data payload and length)
cangen vcan0 -g -i -x (full load test ignoring -ENOBUFS)
cangen vcan0 -g -p -x (full load test with polling, 10ms timeout)
cangen vcan0 (my favourite default :) root@android:/data/local #
I.MX6 Android can-utils 移植的更多相关文章
- I.MX6 Android frameworks services 文件架构
/******************************************************************************* * I.MX6 Android fra ...
- I.MX6 Android netperf
/***************************************************************************** * I.MX6 Android netpe ...
- I.MX6 Android U-blox miniPCI 4G porting
/************************************************************************** * I.MX6 Android U-blox m ...
- I.MX6 Android iperf3 porting failed
/***************************************************************************** * I.MX6 Android iperf ...
- I.MX6 Android i2c-tools porting
/************************************************************************** * I.MX6 Android i2c-tool ...
- I.MX6 Android 移除 Settings wifi功能
/********************************************************************* * I.MX6 Android 移除 Settings w ...
- I.MX6 Android USB Touch eGTouchA.ini文件存放
/******************************************************************** * I.MX6 Android USB Touch eGTo ...
- I.MX6 android BatteryService jni hacking
/**************************************************************************** * I.MX6 android Batter ...
- I.MX6 AW-NB177NF WIFI 驱动移植问题
/******************************************************************************** * I.MX6 AW-NB177NF ...
随机推荐
- 【贪心】codeforces B. Heidi and Library (medium)
http://codeforces.com/contest/802/problem/B [题意] 有一个图书馆,刚开始没有书,最多可容纳k本书:有n天,每天会有人借一本书,当天归还:如果图书馆有这个本 ...
- sed命令解析[转载]
1.简介 sed是非交互式的编辑器.它不会修改文件,除非使用shell重定向来保存结果.默认情况下,所有的输出行都被打印到屏幕上. sed编辑器逐行处理文件(或输入),并将结果发送到屏幕.具体过程如下 ...
- equals() 和 hashCode()
equals() 和 hashCode()这两个方法在java.lang.Object中,所有的类都可以继承这两个方法: 但是,这两个方法在Object类中的实现一般没什么用,所以你通常需要自己重载这 ...
- poj1376 bfs,机器人
开始时候有点怕, 感觉什么也不会,不过静下来思考思考也就想出来了,一个简单的BFS即可,但是由于队列没有重判,一直爆队列(MLE!)下次一定要注意! (bfs第一次到达便最优?) #include&l ...
- BNUOJ Eeny Meeny Moo
Eeny Meeny Moo Time Limit: 1000ms Memory Limit: 65535KB 大家都有这种经验,当太多的人同时使用互联网的时候 ...
- 【TFS 2017 CI/CD系列 - 02】-- Build篇
.创建Build 登录TFS,在现有的[Projects]中选择一个需要要创建Build的Project,点击[Build & Release]跳转页面 在新页面中选择[Builds]选项卡, ...
- Oracle 行转列小结
近期在工作中.对行转列进行了应用,在此做一个简单的小结. 转换步骤例如以下: 1.创建表结构 CREATE TABLE RowToCol ( ID NUMBER(10) not null, U ...
- [PythonCode]扫描局域网的alive ip地址
内网的主机都是自己主动分配ip地址,有时候须要查看下有那些ip在使用,就写了个简单的脚本. linux和windows下都能够用,用多线程来ping1-255全部的地址,效率不高.2分钟左右. 先凑合 ...
- linux 下shell脚本执行多个命令的方法
1.每个命令之间用;隔开说明:各命令的执行给果,不会影响其它命令的执行.换句话说,各个命令都会执行,但不保证每个命令都执行成功. 2.每个命令之间用&&隔开说明:若前面的命令执行成功, ...
- C#中list比数组效率低多少
对于List,即长度不确定的数组而言,十万笔数据*12倍,就是120万笔数据,只需要93ms左右 换成了二维数组,效果也是差不多,78ms,可见list的效率只比double差一点点