Code:def discovered(error, devices, cb_param): if error == 0: #tell("devices: " + str(devices)) tell(" ") for address, name in devices: tell("Found: " + address + " | " + name) if address == "00:10:dc:e9:50:37" : fireupfile1() elif address == "00:11:67:1e:62:a0" : fireupfile2() else : fireupfile3() while(1): try: _discoverer = BtDeviceLister() _discoverer.discover_all(discovered, None) tell("discovering") e32.ao_sleep(100) print "scanning again" except: tell("init failure") appuifw.note(u"Fatal error.", "error")
This program should scan from 100 to 100 seconds for Bluetooth devices.
If it finds 2 particular devices ( by their MAC address ) then it sends 2 different files through ftp GPRS -fireupfile1() and fireupfile2()
If not then sends another file through ftp GPRS -fireupfile3()
My problem is :
the program sends fireupfile1() and fireupfile2() if it finds the particular Bluetooth devices but does not send fireupfile3() if it does not find any Bluetooth device in the area or not the Bluetooth device mentioned above.
Can u give me a clue pleaseeee!!?

Reply With Quote

