bluetooth port in linux
hcitool inq
12374 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
hcitool inq
import bluetooth target_name = "My Phone" target_address = None nearby_devices = bluetooth.discover_devices() for bdaddr in nearby_devices: if target_name == bluetooth.lookup_name( bdaddr ): target_address = bdaddr break if target_address is not None: print "found target bluetooth device with address ", target_address else: print "could not find target bluetooth device nearby"
# need to install these 2 modules from PDIS first import aosocketnativenew from aosocket.symbian.bt_device_discoverer import * def callback(error, devices, cb_param=None): for address, name in devices: print "Found: ", name, address # You can get more data by importing socket and try # bt_discover(address) or bt_obex_discover(address) # see details in official pys60 doc on socket module lister = BtDeviceLister() lister.discover_all(callback, None)
from socket import * a = '00:10:60:ab:25:6f' bt_obex_discover(a) # found at port 3 f = u'C:\\Nokia\\Startermonlog.txt' bt_obex_send_file(a, 3, f)