用于升级外部主板的 Android 应用程序
背景:
我们创建了一个 Android 应用程序,目前通过蓝牙连接与外部主板进行通信。该板依次发出命令以不同的速度运行一个或多个电机。 (该应用程序是为海洋行业的特定任务而构建的)
我们的目标是增强该应用程序,以便 Android 移动用户(将来)能够通过在通过蓝牙连接的应用程序上发出命令来升级主板的固件。
主板使用称为YMODEM
的旧标准通信协议。 http://en.wikipedia.org/wiki/YMODEM 主板支持此功能,我们目前能够在Windows平台上使用超级终端处理固件升级。
我的问题是:
是否可以在Android应用程序中使用YMODEM协议来执行重新刷新?
如果是,怎么办?任何帮助将不胜感激!!感谢您对此进行调查!
Background:
We created an Android app that currently communicates with an external mother board via Bluetooth connection. The board in-turn issues commands to run one or more motor(s) at different speeds. (This application was built for a specific task in the marine industry)
Our goal is to enhance the application so that android mobile users (in the future) will be able to upgrade the motherboard's firmware by issuing a command on the application connected via Bluetooth.
The motherboard uses an old standard communications protocol called YMODEM
. http://en.wikipedia.org/wiki/YMODEM The mother board supports this function and we are currently able to handle the firmware upgrade using hyper terminal on a windows platform.
My question is:
Is it possible to use the YMODEM protocol in an android application to perform a re-flash?
If yes, how? Any help would be appreciated!!Thanks for looking into this!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于迟到的回复表示歉意,但这可能会有所帮助......是的,这绝对是可能的。我已经使用 Nexus 7 和带有 ARM 处理器的外部设备完成了此操作。 Nexus 7 必须在启用 USB 调试的情况下获得 root 权限。我使用了 wugfresh nexus root 工具包——非常简单。
接下来(请坐在座位上),您必须编写应用程序以使用 YModem 协议。一种选择是使用android NDK(本机开发套件)编译用C/C++编写的YModem协议(尝试Tixy 的)。如果您使用的是 Windows,则在安装 NDK 之前需要安装 cygwin 或 mingw。
假设您使用的是 Windows,并且 NDK 安装在
c:\android-ndk-r8b-windows\android-ndk-r8b
中。您可以使用安装了 adt 插件的 Eclipse,假设您的项目的新工作空间是 c:\android-workspace。您可以使用批处理文件从项目中执行 NDK make (c:\android-workspace\batch.bat
):只需确保导出 C/C++ 函数,以便它们可以被使用您的 JAVA 安卓应用程序。
Interface.cpp:
还要确保将该文件和其他
.c
、.cpp
、.h
文件放入jni< /code> 项目文件夹中的文件夹,例如
c:\android-workspace\prog-name\jni
,以及Android.mk
文件(还有很多其他有关Android.mk
文件的堆栈问题)。您可以将要刷新的二进制文件放在
/sdcard/
上的文件夹中。下载文件浏览器来查看它们。Apologies for the late response, but it might be helpful... Yes, it is definitely possible. I have done exactly this with a nexus 7 and an external device with an ARM processor. The nexus 7 must be rooted with USB debugging enabled. I used wugfresh's nexus root toolkit -- it was very easy.
Next (hold onto your seats), you must write your application to use the YModem protocol. One option is to use the android NDK (Native development kit) to compile a YModem protocol written in C/C++ (Try Tixy's). You'll need cygwin or mingw before you install the NDK if you're working with Windows.
So let's say your using windows and you have the NDK installed in
c:\android-ndk-r8b-windows\android-ndk-r8b
. You can use Eclipse with the adt plugin installed, and let's say your new workspace for the project is c:\android-workspace. You can use a batch file to execute NDK make from your project (c:\android-workspace\batch.bat
):Just make sure you export the C/C++ functions so that they can be used by your JAVA android application.
Interface.cpp:
Also make sure you put that file and other
.c
,.cpp
,.h
files in thejni
folder in your project folder, e.g.c:\android-workspace\prog-name\jni
, along with anAndroid.mk
file (there are plenty of other stack questions aboutAndroid.mk
files).You can put the binaries that you want to flash in a folder on the
/sdcard/
. Download a file browser to see them.