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 ...
随机推荐
- HDU 2462 The Luckiest number
The Luckiest number Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. Ori ...
- Food Delivery (区间DP)
When we are focusing on solving problems, we usually prefer to stay in front of computers rather tha ...
- 73. Spring Boot注解(annotation)列表【从零开始学Spring Boot】
[从零开始学习Spirng Boot-常见异常汇总] 针对于Spring Boot提供的注解,如果没有好好研究一下的话,那么想应用自如Spring Boot的话,还是有点困难的,所以我们这小节,说说S ...
- 公钥加密算法那些事 | RSA 与 ECC 系统对比
一.背景 据记载,公元前 400 年,古希腊人发明了置换密码.1881 年世界上的第一个电话保密专利出现.在第二次世界大战期间,德国军方启用「恩尼格玛」密码机,密码学在战争中起着非常重要的作用. 随着 ...
- BZOJ1693: [Usaco2007 Demo]Asteroids
n<=500 *n的格子,给m<=10000个格子有人,一炮可以清掉一行或一列的人(莫名的爽!)求最少几炮干掉所有人. 经典二分图模型!行成点,列成点,一个点就连接一行一列,表示这一行或这 ...
- Codeforces 658C Bear and Forgotten Tree 3【构造】
题目链接: http://codeforces.com/contest/658/problem/C 题意: 给定结点数,树的直径(两点的最长距离),树的高度(1号结点距离其他结点的最长距离),写出树边 ...
- Caused by: java.lang.IncompatibleClassChangeError: class org.springframework.scheduling.quartz.CronTriggerBean has interface org.quartz.CronTrigger as super class
这是版本的问题: 解决办法有两种: 1.降低Quartz版本,降到1.X去. 2.升级Spring版本到3.1+,根据Spring的建议,将原来的**TriggerBean替换成**TriggerFa ...
- GO语言 --socket.io
socket.io是对websocket的封装以及扩展, 可以跨平台使用, 具体可看官网.. GO语言实现: package main import ( "github.com/googol ...
- jmeter的jmx脚本结构解析
jmeter的jmx脚本是xml文档,简单分析下其结构 xml是树形结构:jmeter界面的树形结构就是xml的结构 一级目录: 二级目录:在一级目录右键后可以看到的,都可以做为二级目录 三级目录.n ...
- Meteor部
一个关于 Meteor 主要事项就是如何轻松部署应用程序.当程序完成后,有一个简单的方法来和世界分享你的应用程序.所有需要做的就是在运行命令提示符窗口下面的代码. C:\Users\Administr ...