4

I want to send At command throug my application to modem. Can some one please let me know how to send AT command thr my application?

Do we need Phone object to send AT command?

The ATResponseParser class parses part of the AT command syntax used to communicate with the mobile radio hardware in a mobile handset. This is, in fact, a command syntax very much like the AT command syntax used by modems, a standard described in the 3GPP document number TS 27.007 and related specifications.

I want to send below AT command to Mode. 6.5 Hangup call +CHUP

Table 13a: +CHUP action command syntax

Command

Possible response(s)

+CHUP


+CHUP=?

Please help me.

Adam Lear
  • 38,111
  • 12
  • 81
  • 101
jitendra Kumar
  • 41
  • 1
  • 1
  • 2
  • Duplicate of http://stackoverflow.com/questions/599443/android-how-to-hang-up-outgoing-call – Christopher Orr Apr 04 '10 at 13:02
  • [http://forum.androidfan.ru/lofiversion/index.php/t2957.html](http://translate.google.ru/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fforum.androidfan.ru%2Flofiversion%2Findex.php%2Ft2957.html) –  Jun 09 '10 at 01:48
  • can you please share the code how's you're sending `AT command` to modem using android – AMAN SINGH Oct 19 '16 at 10:45

2 Answers2

5

There is no method in the Android SDK to let you send AT commands directly to the modem.

All the low-level telephony workings are implemented using internal APIs.

Christopher Orr
  • 110,418
  • 27
  • 198
  • 193
2

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)

example : echo -e "ATD123456789;\r" > /dev/smd0 ----> (call to number 123456789)

rattisuk
  • 407
  • 5
  • 7