Menu

OBEXClient connect fails

Help
Dirk
2008-02-29
2013-04-25
  • Dirk

    Dirk - 2008-02-29

    Hi,

    When running this code i get the following error:

    client = lightblue.obex.OBEXClient(address, 9)
    client.connect()
    <OBEXResponse reason='Bad Request' code=0x40 (0xc0) headers={'description': u'Target missing'}>

    Should I supply a target header and what should it contain?
    Sending files with obexftp works, so my bluetooth config should be ok.

    Regards

     
    • blam

      blam - 2008-03-02

      Yes, you need to send a Target header if you're connecting to a File Transfer service. (I assume obexftp automatically sends this since that's specifically used for connecting to File Transfer services.)

      The lightblue package includes an obex_ftp_client.py example that shows the special Target header that you have to send when you connect to File Transfer services. Basically, just replace

          client.connect()

      with

          FTP_TARGET_UUID = '\xf9\xec{\xc4\x95<\x11\xd2\x98NRT\x00\xdc\x9e\t'
          client.connect({'target': FTP_TARGET_UUID})

      The obex_ftp_client.py example has some other code you might like to check out for sending the various FTP commands.

       
      • Dirk

        Dirk - 2008-03-02

        Thanks a lot! It works

         

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.