Android (Linux) Real-time Monitoring of serial port data, android Real-time Monitoring

Source: Internet
Author: User

Android (Linux) Real-time Monitoring of serial port data, android Real-time Monitoring

Previously, when I was working on the WinCE on-board solution, I had a small tool, TraceMonitor, used to display the debugging information of the application programs on the WinCE system, especially in the real-car debugging, displays the serial data between the CAN box and the host. Because it is necessary to seize the market opportunity, it is often necessary to cooperate with the CAN decoding box manufacturer to debug the automotive terminal software before the new car goes public. TraceMonitor may be useful at this time. When you encounter a problem that you cannot tell which side of the problem is, you can see the data clearly. Sometimes the client's machine encounters an abnormal feature of the original car. You can also directly run the tool to capture serial data in real time and provide it to us to analyze the cause of the problem. However, this tool requires special processing by business applications, which is not universal and implemented at the application layer. It may affect the performance, but it is not as good as it is. Once I debugged RK3188 Android car navigation with GYP, and the car terminal never received the data. The hardware engineer said that the CAN box would certainly be sent, and it had to be around for a long time, at last, we can only connect the USB to the serial port board to the computer to see that there is data, but the frame format is incorrect. If there is a tool on Android that can capture serial data in real time, it will be much easier.

As mentioned in the previous article "use of Android (Linux) line rules", the line rules are used to adjust the Android underlying serial communication framework, unexpectedly, you can easily monitor the data sent and received by the serial port in the driver, and then write an application for display. Just do what you want, and try some gadgets to make it easier for you and others.

The implementation is not complex. First, write a character to drive bonovo_mon, which is used to cache the data sent and received in the line procedure. The ComMon application uses FileInputStream to read and display the data of character devices. For ease of use, it provides functions such as data frame Filtering, hexadecimal display, data storage, and sending and storing data to a specified mailbox, which is much more powerful than TraceMonitor in WinCE, it can monitor all data on the communication serial port, and the Business APP does not need to perform any special processing, and the request cache data is registered with the line procedure only when the character-driven bonovo_mon is opened, therefore, when you do not run ComMon, the system will have almost no impact.

The ComMon interface and main functions are as follows.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.