9

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!

Do you have any solution?

and can i use ADB to send AT command to android?

M.Movaffagh
  • 1,284
  • 5
  • 20
  • 33
  • I have feeling Android has no API for such. But maybe with native C extensions. – Prof. Falken Aug 11 '11 at 07:54
  • @00 00 Sorry but I can't really tell what you are trying to do. If you could give us some more information what AT commands are (maybe a relevant link) and what you want to do in general we would be able to help you. – Janusz Aug 11 '11 at 07:55
  • yes...maybe NDK could help us. but for that we need know some about it s port name and detail. – M.Movaffagh Aug 11 '11 at 07:55
  • 2
    @Janusz : AT command are some commands that you can connect with GSM modem. http://en.wikipedia.org/wiki/AT_command – M.Movaffagh Aug 11 '11 at 07:57
  • 2
    in general i want to say something to GSM modem.for example call a phone number(i do not want use android APIs like telephony and etc.). – M.Movaffagh Aug 11 '11 at 08:00
  • I hope that this is not possible in Android because it would render the Android permission system useless. – Janusz Aug 11 '11 at 08:02
  • @Janusz : it s a great for developers.android better give this permission to root users. – M.Movaffagh Aug 11 '11 at 08:18
  • @Janusz: It wouldn't render anything useless. Only applications with sufficient permissions should be able to start raw communication with the modem. – Jan Hudec Aug 11 '11 at 08:26
  • @Jan That would also be a way. – Janusz Aug 11 '11 at 11:51

1 Answers1

8

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