<legend id='fehIu'><style id='fehIu'><dir id='fehIu'><q id='fehIu'></q></dir></style></legend>
    1. <i id='fehIu'><tr id='fehIu'><dt id='fehIu'><q id='fehIu'><span id='fehIu'><b id='fehIu'><form id='fehIu'><ins id='fehIu'></ins><ul id='fehIu'></ul><sub id='fehIu'></sub></form><legend id='fehIu'></legend><bdo id='fehIu'><pre id='fehIu'><center id='fehIu'></center></pre></bdo></b><th id='fehIu'></th></span></q></dt></tr></i><div id='fehIu'><tfoot id='fehIu'></tfoot><dl id='fehIu'><fieldset id='fehIu'></fieldset></dl></div>
        • <bdo id='fehIu'></bdo><ul id='fehIu'></ul>
        <tfoot id='fehIu'></tfoot>

        <small id='fehIu'></small><noframes id='fehIu'>

        在Android上访问本机串口

        Access native serial port on Android(在Android上访问本机串口)
        <legend id='Bo5UB'><style id='Bo5UB'><dir id='Bo5UB'><q id='Bo5UB'></q></dir></style></legend>

          <small id='Bo5UB'></small><noframes id='Bo5UB'>

            • <bdo id='Bo5UB'></bdo><ul id='Bo5UB'></ul>

              <i id='Bo5UB'><tr id='Bo5UB'><dt id='Bo5UB'><q id='Bo5UB'><span id='Bo5UB'><b id='Bo5UB'><form id='Bo5UB'><ins id='Bo5UB'></ins><ul id='Bo5UB'></ul><sub id='Bo5UB'></sub></form><legend id='Bo5UB'></legend><bdo id='Bo5UB'><pre id='Bo5UB'><center id='Bo5UB'></center></pre></bdo></b><th id='Bo5UB'></th></span></q></dt></tr></i><div id='Bo5UB'><tfoot id='Bo5UB'></tfoot><dl id='Bo5UB'><fieldset id='Bo5UB'></fieldset></dl></div>

                <tfoot id='Bo5UB'></tfoot>

                    <tbody id='Bo5UB'></tbody>
                  本文介绍了在Android上访问本机串口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想授予 android 应用程序/服务对本机串行端口 (UART RS-232) 的访问权限.当我说本机时,我指的是真正的 UART,而不是 USB 转串行加密狗.我可以从终端看到它们(连接到 4 个本机串行端口之一).它表明内核已经处理了低级的东西.

                  I want to give android application/service access to native serial port (UART RS-232). When I say native, I mean a real UART not a USB to serial dongle. I can see them from the terminal (connected to one of the 4 native serial port). It shows that kernel already takes care of the low level stuff.

                  # ls -l /dev 
                  crw-rw-rw- system   system   204,  67 2010-01-01 07:00 s3c2410_serial3
                  crw-rw-rw- system   system   204,  66 2010-01-01 07:00 s3c2410_serial2
                  crw-rw-rw- system   radio    204,  65 2010-01-01 07:00 s3c2410_serial1
                  crw-rw-rw- system   system   204,  64 2010-01-01 07:00 s3c2410_serial0 
                  

                  我用姜饼.我已将 Android 移植到具有 S5PV210 处理器的平台上.我完全控制内核和权限.我已经修改了很多东西(蜂窝、触摸屏、LCD 面板尺寸等),包括 init.rc 文件.

                  I use Gingerbread. I have ported Android to my platform which has a S5PV210 processor on. I have full control of the kernel and the permissions. I already modified a lot of things (cellular, touchscreen, LCD panel size etc) including the init.rc file.

                  如何通过 Android APK 与这些设备通信?如您所见,s3c2410_serial1"来自用户radio",因为我获取 Gingerbread 源代码的原始系统在该串行端口上有一个 GPRS 模块.在 init.rc 中很容易更改.但这只是证明我们至少可以访问 Android 系统上的本机串行端口.

                  How can I talk to those devices from an Android APK? As you can see "s3c2410_serial1" is from user "radio" because the original system I took the Gingerbread source code from had a GPRS module on that serial port. It's easy to change in the init.rc. But that just prove we can access a native serial port on an Android system, at least.

                  应用程序或服务不需要控制 APK 的波特率或任何花哨的东西.我只想发送和接收字符.内核可以设置默认波特率,我对此很满意.我什至不需要控制 RTS/CTS.

                  The applications or services will not need to control over the baud rate or any fancy stuff to the APK. I just want to send and receive characters. The kernel can set a default baudrate and I'm happy with that. I don't even need control over RTS/CTS.

                  感谢任何提示.

                  推荐答案

                  我找到了办法.它似乎适用于任何类型的设备,因为它只是将设备作为文件访问.请参阅链接 android-serialport-api.它适用于任何类型的/dev/... 在我的情况下,我必须安装 NDK 并通过所有的 hooplas 才能让它工作.在 C 语言中有一段代码用于设置波特率.其实open和close都是用C实现的,剩下的都是标准的android java.

                  I found a way. It seems to work for any kind of device because it just access the devices as a file. See the link android-serialport-api. It works for any kind of /dev/... In mhy case I had to install the NDK and go through all the hooplas to get it to work. There is a piece of code done in C where it sets the baud rate. In fact, the open and close are implemented in C the rest is all standard android java.

                  这篇关于在Android上访问本机串口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  iOS AutoLayout - get frame size width(iOS AutoLayout - 获取帧大小宽度)
                  script.sh: line 1: ./gradlew: No such file or directory on Jenkins(script.sh:第 1 行:./gradlew:Jenkins 上没有这样的文件或目录)
                  Arduino: using Serial and Software Serial with bluetooth module(Arduino:使用带有蓝牙模块的串口和软件串口)
                  Android: USB Communication Android lt;-gt; External Device(Android:USB通信Androidlt;-gt;外接设备)
                  Sending commands from a PC to an Android phone - via physical connection (USB, Serial, etc)(从 PC 向 Android 手机发送命令 - 通过物理连接(USB、串行等))
                  Android: RS232 Serial Communication with android device(Android:与安卓设备的RS232串行通信)
                        <bdo id='rC7D0'></bdo><ul id='rC7D0'></ul>
                          <tbody id='rC7D0'></tbody>

                        <small id='rC7D0'></small><noframes id='rC7D0'>

                          <legend id='rC7D0'><style id='rC7D0'><dir id='rC7D0'><q id='rC7D0'></q></dir></style></legend>

                            <tfoot id='rC7D0'></tfoot>
                            <i id='rC7D0'><tr id='rC7D0'><dt id='rC7D0'><q id='rC7D0'><span id='rC7D0'><b id='rC7D0'><form id='rC7D0'><ins id='rC7D0'></ins><ul id='rC7D0'></ul><sub id='rC7D0'></sub></form><legend id='rC7D0'></legend><bdo id='rC7D0'><pre id='rC7D0'><center id='rC7D0'></center></pre></bdo></b><th id='rC7D0'></th></span></q></dt></tr></i><div id='rC7D0'><tfoot id='rC7D0'></tfoot><dl id='rC7D0'><fieldset id='rC7D0'></fieldset></dl></div>