Menu

Strange crash...

Help
akus85
2008-02-08
2013-04-25
  • akus85

    akus85 - 2008-02-08

    Hello in my application i use lightblue module,but i receive (not always) BluetoothError:(0,'Error')

    This is my application written in pys60 and i try it in 6630,n70,e51 and others phones :

    import lightblue

    def ricerca():
        l=[]
        print "Cerco..."
        l=lightblue.findservices(servicetype=lightblue.OBEX)
        f=open("e:\\ListaDevices","a")
        f.write(str(l))
        f.write('\n\n')
        f.close()
        print"Finito..."
        return l
       
       
    lista_devices=ricerca()

    for dev in lista_devices:
        print "device= ",dev[0]
        print "canale=",dev[1]
        print"type= ",dev[2]

    The text error is here:

    Traceback(most recent call last):
    File "C:\System\App\Python\default.py",line 81 in menu_action()
    f()
    File "C:\System\App\Python\default.py",line 65 in query_and_exec
    execfile(script_list[index][1].encode('utf-8'),script_namespace.namespace)
    File "C:\System\App\Python\my\devices.py",line 15 in ?
    lista_devices=ricerca()
    File "C:\System\App\Python\my\devices.py",line 6 in ricerca
    l=lightblue.findservices(servicetype=lightblue.OBEX)
    File "C:\system\libs\lightblue\lightblue.py",line 58 in findservices
    raise_lightbluecommon.BluetoothError(str(e))
    BluetoothError:(0,'Error')

     
    • blam

      blam - 2008-02-12

      Hi,

      It looks like the bt_obex_discover() function in the Python For Series 60 socket module is throwing an exception. This probably means it cannot read the services on one of the remote devices for some reason - I'm not sure what might be causing this exception.

      However, the code in lightblue could be better - it shouldn't raise an exception there, actually. It should just 'continue' the loop so that it doesn't raise an exception just because it failed to search one of the devices. I'll fix that and put out a new release this weekend.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.