×
Namespaces

Variants
Actions
Revision as of 19:50, 24 September 2009 by fasttrack (Talk | contribs)

Archived:How to send files using Bluetooth with PySymbian

From Nokia Developer Wiki
Jump to: navigation, search
{{{width}}}


Article Metadata
Tested with
Devices(s): Nokia N96
Compatibility
Platform(s): S60 2nd Edition, S60 3rd Edition
Article
Keywords: socket
Created: (15 Mar 2007)
Last edited: fasttrack (24 Sep 2009)

Overview

Following code shows how to send files using bluetooth in PyS60.

Code

Example-1

from socket import *    # import module
a = '00:10:60:ab:25:6f' # device address
bt_obex_discover(a) # found at port 3
f = u'C:\\Nokia\\Startermonlog.txt' # file location
bt_obex_send_file(a, 3, f)

Example-2

# import modules
from appuifw import *
from e32socket import *
 
try:
phone = bt_obex_discover() # find bluetooth devices
addr=phone[0]
port=phone[1].values()[0]
file = query(u'File Path', 'text')
bt_obex_send_file(addr, port , file)
note(u'File Sent', 'info') # file sent notification
except Exception, error:
note(unicode(error), 'error') # show if error in sending

Related Links

74 page views in the last 30 days.
×