University of Helsinki Department of Computer Science

Department of Computer Science

Department information


ContextPhone Python interface

ContextPhone now has a Python interface to access the sensor data (aka BlackBoard aka tuplespace). Currently you can just get data from it, but in the future you will be able to put data and requests on it as well.

To test the Python interface, get the latest build from latest/s60v2/ (you will probably want the log-only-X.SIS where X is the latest available date, at the moment log-only-20060630T125936.SIS). After that you can just import contextphone in your Python script.

Please note that the exact data representation might still change...

Example usage 1:

 >>> import contextphone
import contextphone
 >>> bbs=contextphone.bbsession()
 >>> id=bbs.get(contextphone.CELLID)
 >>> print id
print id
{u'priority': 2L, u'eventname': u'location.value', u'eventdata':
{u'!value': {u'': u'RADIOLINJA', u'location.lac': 9006L,
u'location.cellid': 18L, u'': 3L, u'location.mnc': 5
L, u'location.mcc': 244L}, '!bbtype': (270565662, 1, 1, 0)},
u'datetime': u'20030126T144540'}

Some explanation:

Example usage 2:

import contextphone

def cb(tn, sn, d) :
   print 'tn', tn
   print 'sn', sn
   print 'd', d



Some explanation:

Available data:

(incomplete due to lack of time)


Up to: Context project main page |Department of Computer Science | HIIT Basic Research Unit