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()