implement at command on rooted android and get the result

后端 未结 1 1709
天命终不由人
天命终不由人 2021-01-23 03:02

I\'m a beginner in stackoverflow so I cant add a comment.

I saw this page:
Read command output inside su process

and I tried this answer and it is ok:

1条回答
  •  悲&欢浪女
    2021-01-23 03:42

    First I think you are just sending the AT command to stdout in the shell which will not do anything other than giving you an echo which you read back. For this approach to work you have to redirect the echo command to the serial port device file. Android phones use various devices for this, /dev/ttyGS0 and /dev/smd0 seems to be common names.

    However I would suggest using the program atinput to send AT commands and capture modem responses. It is specifically written to be used from the command line like that. That will relieve you from communicating directly with the modem and the only thing left is the pipe handling reading the response.

    0 讨论(0)
提交回复
热议问题