I've been trying to make a connection of bluetooth with several mac addresses in a list, but it does not work. This is my code:
I would like to have a saved mac addresses inside a list, then inside a while it will try one mac address at a time and try to connect.
import appuifw, socket, e32
mac_address= ['00:24:04:cb:f7:59', '00:02:76:fd:c4:3a']
for i in range (len(mac_address)):
address2, services = bt_discover(mac_address[i])#find services and port number
if 'Server' in services:
channel = services[u'Server']
#while (str(address2) == '00:24:04:cb:f7:59'):
target = (address2, channel)
print "Found Server"
appuifw.note(u"Target is not running a btchat server","error")
#appuifw.note(u"Connection lost", "info")
print "not found..."
I would like also to be able to do a scan, then save the mac addresses in a list without having to see the list that pops out when using bt.discover()