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 ...
随机推荐
- rac的不完全恢复
模拟rac的不完全恢复,虽然小鱼对常规的完全和不完全恢复已经轻车熟路了,还是记录一个不完全恢复完整过程记录下来. 1 首先小鱼做了一个完全备份. RMAN> backup database in ...
- c++之析构函数
#include<iostream>using namespace std;class A{ public: A(){cout<<"A constructi ...
- hdu 1059二进制优化背包问题
#include<stdio.h> #include<string.h> int max(int a,int b ) { return a>b?a:b; } int a ...
- SpringBoot配置Bean的两种方式--注解以及配置文件
一.注解方式 编写实体类: package com.example.bean; import org.springframework.boot.context.properties.Configura ...
- Codevs 3556 科技庄园==洛谷 P2760
时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 Description Life是codevs的用户,他是一个道德极高的用户,他积极贯彻党的十八大精神, ...
- ubuntu,CentOS永久修改主机名
1.查看主机名 在Ubuntu系统中,快速查看主机名有多种方法: 其一,打开一个GNOME终端窗口,在命令提示符中可以看到主机名,主机名通常位于“@”符号后: 其二,在终端窗口中输入命令:hostna ...
- hdu 5200 Trees [ 排序 离线 2指针 ]
传送门 Trees Accepts: 156 Submissions: 533 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 655 ...
- MySQL Slow Log慢日志分析【转】
如果你的MySQL出现了性能问题,第一个需要“诊断”的就是slow log(慢日志)了. slow log文件很小,使用more less等命令就足够了.如果slow log很大怎么办?这里介绍MyS ...
- iOS 自动识别URL(链接)功能的实现
功能需求 在做“沃迪康”聊天功能时,甲方要求发送的网址要自动识别.并点击能自动跳转 功能难点 在实现过程中,所有的文字都是动态获取的,设置富文本属性时,不能按照常规的方法 解决方式 如果只是文字, ...
- Spring Boot使用HandlerInterceptorAdapter和WebMvcConfigurerAdapter实现原始的登录验证
HandlerInterceptorAdapter的介绍:http://www.cnblogs.com/EasonJim/p/7704740.html,相当于一个Filter拦截器,但是这个颗粒度更细 ...