Sending AT Commands in Android Using atinout library

本小妞迷上赌 提交于 2019-12-01 11:44:51

Step 0. Compile atinout for android and install it. For this I have no experience and cannot give any help other than some general guidelines that you need to replace CC = gcc in the Makefile with an appropriate cross compiler.

Step 1. Write all the AT commands you want to run into a file input.txt (using normal '\n' line endings, there is no need to mess with '\r' here).

Step 2. Change the exec line to

Process process = r.exec(new String[] {"su", "-c",
                                      "atinout input.txt /dev/smd0 output.txt"});

Wait for the process to finish execution (process.waitFor() I think).

Step 3. Open the file output.txt and read the output from this instead of process.getInputStream().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!