×
Namespaces

Variants
Actions

Archived:How to send files using Bluetooth with PySymbian

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.


Article Metadata
Tested with
Devices(s): Nokia N96
Compatibility
Platform(s): S60 2nd Edition, S60 3rd Edition
Article
Keywords: socket
Created: cyke64 (15 Mar 2007)
Last edited: hamishwillee (31 May 2013)

Contents

Overview

Following code shows how to send files using Bluetooth in PySymbian.

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

This page was last modified on 31 May 2013, at 04:05.
41 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×