Tuesday, January 4, 2011

Bluetooth sockets on S60 Nokia mobiles

import socket
import e32
s=socket.socket(socket.AF_BT,socket.SOCK_STREAM)
s.connect(("00:19:7e:d8:ec:4b", 1))
while 1:
    cmd=s.recv(1000)
    e32.reset_inactivity()
    print cmd
    try:
        x=eval(cmd)
        print x
    except:
        try:
            exec(cmd)
        except:
            print "Wrong command"

No comments:

Post a Comment