Samsung A900 AT codes

"David Lonie" <[email protected]>
Newsgroups gmane.comp.mobile.bitpim.devel
Message-ID <[email protected]>
I'm using the python script below (much of it adapted from WebSVN -
kryogenix.org - Rev 8 -
/gnome-bluetooth-phones/trunk/backend.py<http://svn.kryogenix.org/filedetails.php?repname=kryogenix.org&path=%2Fgnome-bluetooth-phones%2Ftrunk%2Fbackend.py&sc=1>)
to try to discover the AT+ codes for my samsung a900 in the eventual
goal
of being able to access the calendar. The script works beautifully,
generating AT+XXXX codes and displaying the phone's response, but after a
couple hundred queries the phone stops responding and has to be restarted to
continue. Is there a linux command or a know AT+ code that will reset the
connection without restarting the phone? Having to restart the phone every
couple of minutes is really slowing this down. I'm new to working with
serial tty communications, so even if something should seem obvious, I
probably didn't try it :)

Also, I noticed that Stephen Wood wrote the existing framework for the A900
in trunk. Do you (or anyone else) have any suggestions for getting into the
guts of the phone?


Here's the hacky little python script. It's not well commented, but it's not
that complex either :) Feel free to modify or use it as you see fit:

#  samsungATProbe.py
#
#

import
serial


start = 'GMM'           # Set the string to start at. 'GMM' is the first
code in the for loops below, since it is known to get a response from the
phone.
active = False

#initialize phone
def talk(send):
        ph = serial.Serial('/dev/ttyUSB2', 115200, timeout=0.03)

        ph.flushOutput()
        ph.flushInput()

#       send = 'at+gmm\r'
        ph.write(send)
#       print "s = " + send
        eol, receive_data,blank_line = False, [], 0
        while eol != True:
                receive=ph.readline().strip()
#               print "r = " + receive
                if len(receive) > 0:
                        if receive == send.strip() or receive =='OK' or
receive == 'ERROR':
                                print receive
                                continue
                        else:
                                print
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " + send
                                print receive
                else:
                        blank_line=blank_line+1
                if blank_line > 2: # Some output has a single blank line
within it, so we wait until we get two blank lines before assuming the end
of the output
                        eol = True
        ph.close()


if 1:
        for a in ['G', 'P', 'A', 'B', 'C', 'D', 'E', 'F', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']:
                for b in ['M', 'C', 'A', 'B', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W','X', 'Y',
'Z']:
                        for c in ['M',  'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z']:
                               for d in ['', 'A', 'B', 'C', 'D', 'E', 'F',
'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z']:# No 'R'!!!
                                        if a+b+c+d == start:
                                                active = True
                                        if active:
                                                talk("AT+"+a+b+c+d+'\r')

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08

_______________________________________________
BitPim-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.