Send AT Commands to Android Phone

99封情书 提交于 2019-11-26 19:15:29

问题


I want to Send AT Command to Android phone.

I know SDK does not support this.

but there are two solution :

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

  2. LoopBack on USB.(i think Bluetooth is same)

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.

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

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


回答1:


first you have to root the phone then in adb shell

su

echo -e "AT\r" > /dev/smd0

if you want to see answer use

cat /dev/smd0

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

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"

try echo to /dev/smd0 for other devices

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



来源:https://stackoverflow.com/questions/8284067/send-at-commands-to-android-phone

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