在 android 上使用 AT 命令与调制解调器通话 [英] Talking to modem with AT commands on android

查看:37
本文介绍了在 android 上使用 AT 命令与调制解调器通话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试与发送 AT 命令的 samsung Galaxy s2 plus 和 huawei p1 xl (u9200) 调制解调器通话,但无法得到任何结果.我正在使用 adb shell 发送命令并使用 logcat 查看日志.

I'm trying to talk to samsung galaxy s2 plus and huawei p1 xl (u9200) modem sending AT commands, but can't get any result. I'm sending commands using adb shell and view logs with logcat.

在三星中,当我执行 cat /proc/tty/drivers 时,我得到以下信息:

In samsung when i execute cat /proc/tty/drivers i get the following:

/dev/tty             /dev/tty        5       0 system:/dev/tty
/dev/console         /dev/console    5       1 system:console
/dev/ptmx            /dev/ptmx       5       2 system
/dev/vc/0            /dev/vc/0       4       0 system:vtmaster

rfcomm               /dev/rfcomm   216 0-255 serial
g_serial             /dev/ttyGS    237 0-3 serial
serial               /dev/ttyS       4 64-67 serial
pty_slave            /dev/pts      136 0-1048575 pty:slave
pty_master           /dev/ptm      128 0-1048575 pty:master
unknown              /dev/tty        4 1-63 console

看起来我应该向 /dev/ttyGS0 发送命令,但它没有回复.我尝试了以下命令:

Looks like i should send commands to /dev/ttyGS0, but it doesn't reply. I've tried the following commands:

echo "AT
" > /dev/ttyGS0
echo "ATD12345678900;
" > /dev/ttyGS0

但没有任何反应.实际上,我不确定是否必须向该文件发送命令,但其他人也不会回复.我已经阅读了关于 XDA-developers 的文章,但它没有帮助.

but nothing happens. Actually, i'm not sure that i have to send commands to this file, but others don't reply too. I've read article on XDA-developers, but it didn't help.

有了华为,我知道我应该使用哪个文件,但我无法拨打数据电话.我可以进行常规语音通话,但无法执行AT+CSNS=4.就是不行.我还有 LG P765,它基于类似的芯片组,在 LG 上我可以进行数据通话.谁能告诉我该怎么办?

With Huawei i know which file i should use, but i can't make data call. I can make regular voice call, but i can't execute AT+CSNS=4. Just doesn't work. Also i have LG P765, which is based on a similar chipset and on LG i can make data call. Can anyone tell me what should i do?

所有设备都已植根.

推荐答案

我建议您尝试使用 发送 AT 命令tinout 程序,例如而不是将输出重定向到调制解调器设备运行

I suggest that you try to send AT command using the atinout program, e.g. instead of redirecting output to the modem device run

echo "ATD12345678900;" | atinout - /dev/ttyGS0 -

我在猜测,但可能是 adb shell 中的 echo 命令没有将 解释为任何特殊的东西(这至少可以解释没有任何响应).通过使用 atinout,您可以保证 AT 命令行以 正确终止,并且捕获应该更简单并且工作更可靠.

I am guessing, but it could be that the echo command in the adb shell does not interpret as anything special (that would at least explain no response whatsoever). By using atinout you are guarantied that AT command lines are properly terminated with and capturing should be simpler and work much more reliably.

这篇关于在 android 上使用 AT 命令与调制解调器通话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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