views:

103

answers:

1

ok folks, heres my dilemma i want to make a chat program that uses sms as its base engine.. to do this i need to communicate with my gsm phone via bluetooth attached to com 7 on my computer.. i can do this fine using hyperterminal, tera term etc. but to hav an un-obtrusive, friendly interface i need a command line tool to send AT commands, (and receive responses) to/from my mobile phone through my com port.. i have been searching for days to no avail.. please help

A: 

It's probably not exactly what you want but I wrote a python framework for communicating via AT-commands. It supports data cables, bluetooth on Linux and Windows (written in Python 2).

A sample program built with that framework is RecNPlay. With RecNPlay you are able to record (, save) and playback keystrokes on your mobile phone.

You could take RecNPlay as an example and program your own tool to communicate. The library RecNPlay is built on is called PyGSMLib and provides python-wrappers to a lot of AT-commands and supports 'AT unsolicited results'.

Sample python program which listens to Nokia specific GPRS events (like connect, disconnect from mobile, disconnect by network):

device = sys.argv[1]

sconn = None
comm = None
try:
    sconn = Serial(device, 9600, timeout=3)
    print "Initializing V250 connection...",
    comm = V250Communicator(sconn)
    print "ok"
    gsm = NokiaController(comm, True)
    gsm.nokiaEnableGprsEventReporting()
    def listen(msg):
        print "Unknown: %s" % str(msg)

    comm.setUnsolicitedResultListener(listen)
    import os
    os.sys.stdin.readline()
finally:
    if sconn:
        sconn.close()
Johannes Weiß