Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 21:09, 5 April 2008.

How to send text from Mobile to PC

From Forum Nokia Wiki

Below code is useful for sending text from mobile to PC using Python.

import appuifw
import socket
import e32
 
 
def bt_connect():
    global sock
    sock=socket.socket(socket.AF_BT,socket.SOCK_STREAM)
    target=''
    if not target:
        address,services=socket.bt_discover()
        print "Discovered: %s, %s"%(address,services)
        if len(services)>1:
            import appuifw
            choices=services.keys()
            choices.sort()
            choice=appuifw.popup_menu([unicode(services[x])+": "+x
                                        for x in choices],u'Choose port:')
            target=(address,services[choices[choice]])
        else:
            target=(address,services.values()[0])
    print "Connecting to "+str(target)
    sock.connect(target)
    print "OK."
 
    bt_typetext()
        
 
def bt_typetext():
    global sock
    test = appuifw.query(u"Type words", "text", u"")
    if test == None:
        exit_key_handler()
    else:
        sock.send(test)
        bt_typetext()
 
def exit_key_handler():
    script_lock.signal()
    appuifw.app.set_exit()
 
appuifw.app.title = u"Mob to PC"
 
script_lock = e32.Ao_lock()
 
appuifw.app.exit_key_handler = exit_key_handler()
 
bt_connect()
 
script_lock.wait()
Related Discussions
Thread Thread Starter Forum Replies Last Post
all the things you can send another phone over BT ronikoren Bluetooth Technology 2 2008-01-08 15:58
SENDING OTHER LANGUAGE MESSAGES FROM PC TO MOBILES siva_guduru PC Suite API and PC Connectivity SDK 0 2006-09-04 09:04
Sending Mms fix78 General Messaging 1 2003-04-25 23:12
How to read the notes of a Nokia mobiles?? hassan83 Python 3 2008-03-06 18:47
Sending voice over bluetooth headset kaberi Bluetooth Technology 3 2008-06-04 09:16
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZpythonQ
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX