计算机应用 ›› 2013, Vol. 33 ›› Issue (09): 2467-2469.DOI: 10.11772/j.issn.1001-9081.2013.09.2467

• 网络与通信 • 上一篇    下一篇

Android系统下SAE J1939协议的移植

李佳1,亓妍妍1,朱维杰2   

  1. 1. 武警工程大学 研究生管理大队, 西安 710086;
    2. 武警工程大学 信息工程系, 西安 710086
  • 收稿日期:2013-03-21 修回日期:2013-04-27 出版日期:2013-09-01 发布日期:2013-10-18
  • 通讯作者: 李佳
  • 作者简介:李佳(1987-),男,河北晋州人,硕士研究生,主要研究方向:嵌入式系统;
    亓妍妍(1986-),女,山东莱芜人,硕士研究生,主要研究方向:嵌入式系统;
    朱维杰(1971-),男,陕西西安人,副教授,博士,主要研究方向:阵列信号处理、嵌入式系统。

Porting of protocol SAE J1939 to Android system

LI Jia1,QI Yanyan1,ZHU Weijie2   

  1. 1. Graduate Management Brigade, Engineering University of Chinese People's Armed Police Force, Xi'an Shaanxi 710086, China;
    2. Department of Information Engineering, Engineering University of Chinese People's Armed Police Force, Xi'an Shaanxi 710086, China
  • Received:2013-03-21 Revised:2013-04-27 Online:2013-10-18 Published:2013-09-01
  • Contact: LI Jia

摘要: 针对Android系统下的控制器局域网(CAN)总线缺少应用层驱动的现状,提出了一种将Linux系统中的CAN总线应用层驱动移植到Android系统中的方法。选择SAE J1939协议作为Android系统下CAN总线应用层协议并移植由Kurt Van Dijck和Pieter Beyens维护的linux-can-j1939项目。首先分析项目结构,将对应文件合并到Android内核代码中;然后修改头文件、协议实现代码并增加内核缺失的结构体、函数等;最后修改Makefile和Kbuild文件并编译生成内核。实验结果表明:编译后的Android内核实现了SAE J1939协议所规定的地址声明、数据拆包重组、网络管理等功能。应用层驱动移植后,通过调用Android应用层接口就可开发丰富的基于CAN总线的Android应用程序。

关键词: Android, SAE J1939, 控制器局域网总线, 移植, 驱动

Abstract: Considering the fact that there is a lack of Controller Area Network (CAN) bus application-layer driver in Android system, a method was developed to transplant the CAN bus application-layer driver from Linux to Android system. SAE J1939 protocol was selected to be the protocol of Android CAN bus application-layer protocol and the linux-can-j1939 project developed by Kurt Van Dijck and Pieter Beyens was ported to Android system. First, the authors analyzed the project structure and merged the corresponding files to Android kernel, then modified the header files and protocol implementation sources, and added the missing structures and functions in kernel. Finally, Android kernel was compiled after modifying the Makefile and Kbuild files. The experiment results show that the new kernel realizes the functions of SAE J1939 protocol such as address declaring, data packing and unpacking, and network management. Based on this porting, a variety of CAN-based Android applications can be developed with the help of Android application-layer interface.

Key words: Android, SAE J1939, Controller Area Network (CAN) bus, porting, driver

中图分类号: