Android中的AT命令 [英] AT command in Android
问题描述
我想在我的应用程序中使用 AT 命令为 GSM 调制解调器设置一些命令.
I want to use AT command in my application to set some order to GSM modem.
我搜索了谷歌,但找不到任何好的答案!
I searched Google but i could not find any good answer!
你有什么解决办法吗?
我可以使用 ADB 向 android 发送 AT 命令吗?
and can i use ADB to send AT command to android?
推荐答案
首先你要root手机,然后在adb shell中
first you have to root the phone then in adb shell
su
echo -e "AT
" > /dev/smd0
如果你想看到答案使用
cat /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)
示例:echo -e "ATD123456789; " >/dev/smd0 ---->(拨打号码 123456789)
example : echo -e "ATD123456789; " > /dev/smd0 ----> (call to number 123456789)
这篇关于Android中的AT命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!