基于Java异步串行通信技术的研究
DOI:
CSTR:
作者:
作者单位:

(四川大学 电气信息学院,成都 610065)

作者简介:

马 赛(1992-),男,北京人,本科,主要从事信号与信息处理方向的研究。[FQ)]

通讯作者:

中图分类号:

TP312JA

基金项目:

航空科学基金项目(20100119004);国家级大学生创新创业训练计划项目(201310610109)。


Study of Asynchronous Serial Communication Technology Based on Java Communication API
Author:
Affiliation:

(School of Electrical and Information Engineering, Sichuan University, Chengdu 610065,China)

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    Java Communication API是Java平台下用于串口通信程序开发的唯一官方解决方案,Java串口通信程序均可以由官方提供的开发包中的示例程序括展;但以示例程序为基础开发的Java串口通信程序一般都存在着在异步通信模式下无法完整接收长串数据的缺陷;为解决这一问题,根据通信前收发信双方可以约定通信的数据长度这一特点,提出一种对接收到的字节进行计数的方法,以接收的数据长度为指标判断通信是否结束;通过实际编程验证,该方法克服了上述缺陷,具有很好的可行性与实用性,可以广泛应用于各种使用Java Communication API进行开发的场合。

    Abstract:

    Java Communication API is the only official solution for serial communication. Java serial communication program can be developed based on the sample in the Java Communication API developer toolkit, but such program has the defect that it cannot receive long data string continuously in asynchronous mode. In order to solve this problem, according to the characteristic that transceiver both sides know the length of data to be transferred in asynchronous mode, proposed a method which is to count the number of bytes received, using the counted number as the criteria to judge whether the communication is ended. Verified by programming, the method overcomes the shortcoming above. It is proved that the method has good feasibility and practicality, and can be widely used in various programming using the Java Communication API.

    参考文献
    相似文献
    引证文献
引用本文

马赛,王忠,陈典.基于Java异步串行通信技术的研究计算机测量与控制[J].,2014,22(8):2644-2646,2649.

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2014-05-13
  • 最后修改日期:2014-06-10
  • 录用日期:
  • 在线发布日期: 2014-12-16
  • 出版日期:
文章二维码