向 Android 手机发送 AT 命令 [英] Send AT Commands to Android Phone

查看:115
本文介绍了向 Android 手机发送 AT 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向 Android 手机发送 AT 命令.

I want to Send AT Command to Android phone.

我知道 SDK 不支持这个.

I know SDK does not support this.

但是有两种解决方案:

  1. 修改Kernel的代码,发布你的新Android(看起来好难!)

  1. change the code of Kernel and release your new Android (it seems it is so hard!)

LoopBack on USB.(我认为蓝牙是一样的)

LoopBack on USB.(i think Bluetooth is same)

关于第二种解决方案,当您使用USB 电缆将手机连接到PC 时,您将在设备管理器中看到一个GSM 调制解调器,可帮助您将AT 命令发送到GSM 调制解调器.

About second solution , when you connect your phone to PC with USB cable , you will see a GSM modem on Device Manager that help you to send AT Command to GSM Modem.

如果找到手机回环的解决方案,我们可以向GSM Modem发送AT命令.

If we find a solution to loop back on mobile phone , we can send AT commands to GSM Modem.

问题是:如何回环以及内核上的哪个 tty 文件对我们有帮助?

Question is : HOW to loop back and what tty file on kernel will help us?

推荐答案

首先你得把手机root在 adb shell 中

first you have to root the phone then in adb shell

echo -e "AT ";>/dev/smd0

echo -e "AT " > /dev/smd0

如果你想看到答案使用

猫/dev/smd0

我已经在 samsung mini,cooper,s+ 中测试了这个命令并且它有效.

i've test this command in samsung mini,cooper,s+ and it works.

如果您使用 htc(经过 htc 韵测试)尝试 adb shell 并键入此命令radiooptions 13 AT";如果你想看到答案类型logcat -b radio"

if you use htc (htc rhyme tested) try to adb shell and type this command "radiooptions 13 AT" if you want to see answer type "logcat -b radio"

为其他设备尝试回显到/dev/smd0

try echo to /dev/smd0 for other devices

*您可以在 sdk java 代码中使用 Runtime.exec (require su) 使用此命令

*you can use this command in sdk java code by using Runtime.exec (require su)

这篇关于向 Android 手机发送 AT 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆